3 Replies Latest reply on Aug 3, 2006 10:20 AM by Newsgroup_User

    FLASH 8 -------> flvPlayback component (play next video after finished)

    volcomp
      Hi All,

      My Challenge is this...

      To feed up to 5 video references (filepaths) into the SWF which contains the FLVPlayBack component, and have these play in sequence automatically.

      Once the first video ends, the next begins...

      Currently our FLV player takes 1 filepath passed by FlashVars and play it.

      First things first... I just want to get the function of having one .flv file play after the first has finished... do I need some kind of listener?

      Thanks,
      B
        • 1. Re: FLASH 8 -------> flvPlayback component (play next video after finished)
          Level 7
          volcomp,

          > First things first... I just want to get the function of
          > having one .flv file play after the first has finished...
          > do I need some kind of listener?

          You do. :)

          You'll need a listener to listen for one of the events (it'll be
          obvious) in the Event summary of the FLVPlayback class listing of the
          Components Language Reference. Remember, events are things an object can
          react to (such as reacting to the end of an FLV file). Methods are things
          an object can do (such as playing the next FLV file). Properties are
          attributes *of* an object. These three categories -- properties, methods,
          and events -- are spelled out in the class entry for every object in
          ActionScript. Makes it really convenient. :)

          The ActionScript Language Reference generally has all three summaries --
          if all three are available (there may only be one or two -- in the class
          entry for each object. For some reason, the Components Language Reference
          usually separates them.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: FLASH 8 -------> flvPlayback component (play next video after finished)
            volcomp Level 1
            Thanks David for the quick response...

            Could you provide an example of the listener in question?... Do listeners differ from Flash 8 to Flash 7?

            Here is an example of the code we are using... (Hope this makes sense)

            FRAME 1 - link buttons to flvPlayback component (no stop commands untill the last frame)

            myFLV.playButton = playbtn;
            myFLV.pauseButton = pausebtn;
            myFLV.muteButton = mutebtn;
            myFLV.seekBar = seekbar;
            myFLV.bufferingBar = bufferbar;

            FRAME 2

            urlLoad="includes/video/video_load.php?videoID="+_root.videoID;

            trace(urlLoad);

            //begin loading vars
            loadVariablesNum(urlLoad,0);

            FRAME 3

            if(EOF=="true"){
            gotoAndPlay(5);
            }

            FRAME 4


            if(EOF==1) {
            gotoAndPlay(5)
            }
            else{
            gotoAndPlay(3)
            }

            FRAME 5

            trace(video_loaded);

            //play video

            _root.myFLV.play(video_loaded);

            stop();



            I think on FRAME 5 when the video is loaded we need the listener...



            • 3. Re: FLASH 8 -------> flvPlayback component (play next video after finished)
              Level 7
              volcomp,

              > Could you provide an example of the listener in
              > question?... Do listeners differ from Flash 8 to Flash 7?

              Listeners are the same. Honestly, there's sample code right in the
              Events summary of the FLVPlayback class entry of the Components Language
              Reference. See FLVPlayback.complete.

              > Here is an example of the code we are using... (Hope
              > this makes sense)

              Okay. :)

              > FRAME 1 - link buttons to flvPlayback component
              > (no stop commands untill the last frame)
              >
              > myFLV.playButton = playbtn;
              > myFLV.pauseButton = pausebtn;

              Okay, looks like you're setting custom buttons.

              > FRAME 2
              > urlLoad="includes/video/video_load.php?videoID="+_root.videoID;
              >
              > trace(urlLoad);
              >
              > //begin loading vars
              > loadVariablesNum(urlLoad,0);

              What are these variables for? This is the list of videos?

              > FRAME 3
              >
              > if(EOF=="true"){
              > gotoAndPlay(5);
              > }

              Okay, I think I see what's going on here. One of the variables in your
              PHP return string is EOF, and you're using a loop technique to check if the
              rest of the variables have been loaded, right?

              While this should work, it's a bit old school. Have you looked into the
              LoadVars class? It's new since Flash Player 6, and raises a LoadVars.onLoad
              event, which lets you bypass the timeline looping. It's the more
              object-oriented approach and seems cleaner to me -- plus, by listening for
              that event, you'll be using the same technique as listening for the
              FLVPlayback.complete event. ;)

              Your "first things first" sentiment in the first post was the right
              approach, definitely. Don't try to do too many things at once. Start with
              a single FLV path (a string, of course) and hard code that in a new FLA --
              something without the "baggage" of the rest of the code here. One FLV is
              all you need, just to be able to illustrate to yourself how to listen for
              that complete event ... have it trace() a message to the Output panel, for
              example.

              When you manage that -- and it's not hard (and I'll help you, if you get
              stuck) -- the next step is to hardcode the paths to two FLVs and play video
              2 after the first one has ended. From there, the rest should fall into
              place.


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."