Wednesday, August 5, 2009

Actionscript to load external swf

What we need is simple : a button to launch the load, an empty clip to load the movie in, and a .swf file (called loaded.swf), in the same folder as the present movie.
  • Create a button to load swf file
  • Create an empty movie clip by pressing Ctrl+F8, give movieclip a Name as well as an Instance Name. Now open the library with Ctrl+L and drag and drop the movie clip on a new layer of your scene. (no reference to which part of timeline, just drag it in.)

After the above are done, Select the button and type below code into it's Actions Panel:

on(release){

loadMovieNum ("load.swf", "Stage");

}

load.swf: is the name of the file that you want to load

Stage: is the name of the movieclip with the instant name Stage

No comments:

Post a Comment