2 Replies Latest reply on Sep 30, 2009 9:33 AM by qtchic86

    Load multiple SWFs containing FLV videos

    qtchic86

      Hello, I'm having a heck of a time trying to get a number of external SWFs loaded into one main SWF in successive order, the next one playing after the other has ended. To complicate matters, the external SWFs have FLV files in them.

       

      using Flash CS3

      Actionscript 3.0

       

      So, here's essentially what I'm looking to do:

      - I have one main SWF file (call it main.swf)

      - load several SWF files into this file so they play in order (let's call them movie1.swf, movie2.swf, movie3.swf, and so on)

      - these external SWF files all have FLV progressive downloads (not embedded, becuase then my audio doesn't sync up)

      - I want movie1.swf to load and play in the main file, then detect when the movie is complete, and unload that audio/video then load in movie2.swf, and so on.

       

      This script seemed promising, but loads all of my SWFs on top of each other, making for some ::interesting:: audio...

      (i have it pasted in actions on first frame in main.swf)

       

      var a:Array = new Array("movie1.swf", "movie2.swf", "movie3.swf");
      var tl:MovieClip=this


      var index:uint=0;


      loadF(new Event("nada"));


      function loadF(e:Event){


      if(index<a.length){

      tl["ldr_"+index]=new Loader();

      tl["ldr_"+index].x=index*1000;  // or whatever

      addChild(tl["ldr_"+index]);

      tl["ldr_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,loadF);

      tl["ldr_"+index].load(new URLRequest(a[index]));

      index++;

      }

      }

       

      Maybe there's some code that can be pasted in the individual SWFs? i dunno... please help!!

       

      Any help is GREATLY APPRECIATED!!!! Thanks!