3 Replies Latest reply on Oct 14, 2009 4:55 AM by Ned Murphy

    how do you load an swf into another FLA document

    richhennosy Level 1

      Well, the headline pretty much says it all. I have gotten some swf files from another designer. I need  to show them in my presentation. I am using Flash CS3 for mac. Any advice would be helpful.

       

      Thanks,

       

      Rich

        • 1. Re: how do you load an swf into another FLA document
          Ned Murphy Adobe Community Professional & MVP

          You can't load swf files into an fla file, but you can load swf files into another swf file.  This is done using actionscript, and how it is coded depends on what version of actionscript your main file is using.

          1 person found this helpful
          • 2. Re: how do you load an swf into another FLA document
            richhennosy Level 1

            I did find a tutorial on this. It was helpful. I am using Actionscript 3.0

             

            Here is the code I used and it works. Except, I need to load another one after this one. Basically it is like a slide show of swf files. I need to play 3 swf files after another without any interaction by the user.

             

            I am thinking I need to tell it to unload the first one and load the second one after the first one is finished and so on. I appreciate any advice.

             

            Rich

             

            var Xpos:Number=0;

            var Ypos:Number=0;

            var swf:MovieClip;

            var loader:Loader=new Loader();

             

            var defaultSWF:URLRequest=new URLRequest("swfs/dannon_1.swf");

             

            loader.load(defaultSWF);

            loader.x=Xpos;

            loader.y=Ypos;

            addChild(loader);

            ////////////////////////////

            • 3. Re: how do you load an swf into another FLA document
              Ned Murphy Adobe Community Professional & MVP

              The cleanest way is to have each swf dispatch an event when they complete so that the main file can take action to remove the current and load the next.  To do this you need to be able to edit the swf files, which means you need their fla files.

               

              Alternatively, if these swf files happen to all be timeline based movies that play frame by frame until they reach the end, where being in th last frame would be an indication of the movie being complete, you could use an ENTER_FRAME event listener to continuously check if the currentFrame value equals the TotalFrames value.  WHen it does reach the last frame your main program detects this and performs the remove.load process.