Welcome, Guest
  • Author Topic: Need to get flv to stop using button  (Read 6162 times)

    Hollie

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    Need to get flv to stop using button
    « on: 03/11/08, 00:14 »
    I have a FLV playback and I have a file set to play a full video, and I also have nav buttons that control other segments of the full flv to play in the same playback instance.

    The problem is that I have 2 additional buttons that I need to link to http: references - I can do that just fine, but I can't get the flv file to stop playing in the background.

    I DESPARATELY NEED HELP!  I've been trying to find a resolution ALL DAY!

    Here is my code - it works aside from the fact that I can't do the above...

    var listenerObject:Object = new Object();
    // listen for complete event; play new FLV
    listenerObject.complete = function(eventObject:Object):Void {
        if (myPlayer.contentPath == "Tax_LifeCycle_Integration.flv") {
            myPlayer.play("The_CORPTAX_Difference.flv");

        }
    };
    myPlayer.addEventListener("complete", listenerObject);

    var listenerObject:Object = new Object();
    // listen for complete event; play new FLV
    listenerObject.complete = function(eventObject:Object):Void {
        if (myPlayer.contentPath == "The_CORPTAX_Difference.flv") {
            myPlayer.play("Provision_to_Return_in60sec.flv");

        }
    };
    myPlayer.addEventListener("complete", listenerObject);




    my1_btn.onRelease = function (){
    myPlayer.contentPath = "full_movie_1200_480x320.flv";
    }
    my2_btn.onRelease = function (){
    myPlayer.contentPath = "Tax_LifeCycle_Integration.flv";
    }
    my3_btn.onRelease = function (){
    myPlayer.contentPath = "The_CORPTAX_Difference.flv";
    }
    my4_btn.onRelease = function (){
    myPlayer.contentPath = "Provision_to_Return_in60sec.flv";
    }

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Need to get flv to stop using button
    « Reply #1 on: 03/11/08, 05:22 »
    To stop your player use:

    myPlayer.stop()

    So when you move to another frame (or hide the component or whatever), remember always to stop it

    Jorge

    Hollie

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    Re: Need to get flv to stop using button
    « Reply #2 on: 03/11/08, 10:29 »
    I have tried this - can you please show me how this works with the entire script attached to a button event (onRelease).

    Thanks!

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Need to get flv to stop using button
    « Reply #3 on: 03/11/08, 11:31 »
    try

    myButton(onPress){
      myPlayer.stop()
    }

    Jorge

    Hollie

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    Re: Need to get flv to stop using button
    « Reply #4 on: 03/11/08, 15:01 »
    Thanks - I will give it a shot!

    Hollie

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    Re: Need to get flv to stop using button
    « Reply #5 on: 03/11/08, 19:09 »
    Hi Jorge,

    I put this code in as an action-button script as well as on the 1st frame of the actions layer and nothing worked.

    **Error** Scene=Scene 1, layer=view, frame=1:Line 1: Syntax error.
         my5_btn(onPress){

    Total ActionScript Errors: 1     Reported Errors: 1


    Any suggestions

    Here is the code

    my5_btn(onPress){
      myPlayer.stop()
    }

    I appreciate your help!

    Hollie

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    Re: Need to get flv to stop using button
    « Reply #6 on: 03/11/08, 21:09 »
    WHOOHOO!

    I figured it out... I took what you gave me and I had to modify it...

    I had to create a var for the player...

    var flvControl = myPlayer


    and then this is the code for the button in the actions layer


    my5_btn.onPress = function (){
      myPlayer.stop()
    }

    Works like a charm!

    Thanks Jorge!