How to Sequentially Play Embedded Video in External SWFs?

  • BENBOB
  • Novice
  • Novice
  • BENBOB
  • Posts: 17

Post 3+ Months Ago

Hi,

Does anyone know how to sequentially play external SWFs loaded into the main timeline?

I have several SWF files with short videos embedded in them. I wish to load these external SWF files into my main timeline as follows:


User Presses Button -> Play Video Clip in External SWF#1 -> Once Video Clip in External SWF#1 has Finished -> Play Video Clip in External SWF#2.


I tried achieving this by adding: “var endmovie:Boolean = true;” to the end of each video clip inside the external SWF’s (e.g. “1.SWF”) then cycling through an if statement in the main timeline to see when this condition was meet:


ActionScript In Main Timeline:
Code: [ Select ]
var mc_Loader = new MovieClipLoader();
mc_Loader.addListener(this);

this.createEmptyMovieClip("Container", this.getNextHighestDepth())
Container._x = 0
Container._y = 0

button_mc.onRelease = function () {

    mc_Loader.loadClip("1.swf",Container);

    function onLoadInit(target_mc:MovieClip) {

        myInterval = setInterval(cycle,30);
        function cycle() {

            if (Container.endmovie == true){
                mc_Loader.loadClip("2.swf",Container);
            }

        }

    }

}
  1. var mc_Loader = new MovieClipLoader();
  2. mc_Loader.addListener(this);
  3. this.createEmptyMovieClip("Container", this.getNextHighestDepth())
  4. Container._x = 0
  5. Container._y = 0
  6. button_mc.onRelease = function () {
  7.     mc_Loader.loadClip("1.swf",Container);
  8.     function onLoadInit(target_mc:MovieClip) {
  9.         myInterval = setInterval(cycle,30);
  10.         function cycle() {
  11.             if (Container.endmovie == true){
  12.                 mc_Loader.loadClip("2.swf",Container);
  13.             }
  14.         }
  15.     }
  16. }



To my surprise, this code does actually work - until you add the "button_mc.onRelease = function () {" part!

How is the best way to go about achieving this? Am I on the right track? (By the way, using .FLV or one long external SWF file is not really an option due to long loading times...I think...)

Please Please Help! :D

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.