3 Replies Latest reply on Mar 20, 2008 12:47 PM by wAyStead

    FLV controllers - DEFINED ?

    wAyStead Level 1
      Hi,

      I'm experimenting with flash video and have 3 streaming files on
      my server, progressively coded.

      1.flv
      2.flv
      3.flv

      i have a shuffle array so that it plays one of the above files
      on start up of the main.swf

      THE BIG QUESTION

      once that FLV file has played back in its entirity how do
      i then get it to automatically play the next FLV in sequence ?



        • 1. Re: FLV controllers - DEFINED ?
          Dan_morley Level 1
          Playing multiple FLV files
          You can play FLV files sequentially in an FLVPlayback instance simply by loading a new URL in the source property when the previous FLV file finishes playing. For example, the following ActionScript code listens for the complete event, which occurs when an FLV file finishes playing. When this event occurs, the code sets the name and location of a new FLV file in the source property and calls the play() method to play the new video.

          1. Press Ctrl F7 - components
          2. Drag a FLVPlayback onto the main stage.
          3. Put my_FLVPlybk into the instance name of the FLVPlayback component.
          4. Press F9 Insert the following code into the actionscript section.
          5. Change the URL names with the flv's you wish to play.


          import fl.video.*;
          my_FLVPlybk.source = " http://www.helpexamples.com/flash/video/clouds.flv";
          my_FLVPlybk.addEventListener(VideoEvent.COMPLETE, complete_listener);
          // listen for complete event; play new FLV
          function complete_listener(eventObject:VideoEvent):void {
          if (my_FLVPlybk.source == " http://www.helpexamples.com/flash/video/clouds.flv") {
          my_FLVPlybk.play(" http://www.helpexamples.com/flash/video/water.flv");
          }
          };
          stop();
          • 2. Re: FLV controllers - DEFINED ?
            Dan_morley Level 1
            Sorry code last night didnt work. sleep helped lol

            There are two ways that are easy to achieve what i think u r after

            To Play a flv and then jump to a frame after its stopped use:

            Create 2 frames.
            on frame 1 put a FLVPlayback component
            give it an instance name of my_FLVPlybk
            on frame 2 put some text as an example
            in the actionscript of frame 2 put stop
            in the actionscript of frame 1 put the following

            import mx.video.*;
            my_FLVPlybk.contentPath = " http://www.helpexamples.com/flash/video/clouds.flv";
            var listenerObject:Object = new Object();
            // listen for complete event; play new FLV
            listenerObject.complete = function(eventObject:Object):Void {
            if (my_FLVPlybk.contentPath == " http://www.helpexamples.com/flash/video/clouds.flv") {
            gotoAndStop(2);
            }
            };
            my_FLVPlybk.addEventListener("complete", listenerObject);
            stop();

            Top play a flv after a flv finishes use:
            1. Press Ctrl F7 - components
            2. Drag a FLVPlayback onto the main stage.
            3. Put my_FLVPlybk into the instance name of the FLVPlayback component.
            4. Press F9 Insert the following code into the actionscript section.
            5. Change the URL names with the flv's you wish to play.


            import fl.video.*;
            my_FLVPlybk.source = " http://www.helpexamples.com/flash/video/clouds.flv";
            my_FLVPlybk.addEventListener(VideoEvent.COMPLETE, complete_listener);
            // listen for complete event; play new FLV
            function complete_listener(eventObject:VideoEvent):void {
            if (my_FLVPlybk.source == " http://www.helpexamples.com/flash/video/clouds.flv") {
            my_FLVPlybk.play(" http://www.helpexamples.com/flash/video/water.flv");
            }
            };
            my_FLVPlybk.addEventListener("complete", listenerObject);
            stop();
            • 3. Re: FLV controllers - DEFINED ?
              wAyStead Level 1
              this looks great...

              the dynamics you have illustrated are exactly the elements i'm looking.

              i'll get back to you...

              and you'll see the results on www.bulletprooftv.com

              (spot the promoter)