Load external SWF files into parent SWF file Using the ActionScript 3.0

The Loader class in ActionScript 3.0 is a
subclass of DisplayObject that you use to load and display external
content. It has a load method that works much the same way as the
ActionScript 2.0 MovieClip.loadMovie command. The load command has
one required parameter, a URLLoader instance with the URL of the
content to load.

The following example creates a Loader instance and loads
into that instance an external movie named “myExternalMovie.swf.”

var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("myExternalMovie.swf");
myLoader.load(url);

The URL of the content being loaded can be relative or
absolute. See Relative Paths below for more
information regarding how the Flash player handles URLs. You can obtain more
information for the content being loaded using event listeners. For more
information on the Loader class, see Loader in
the Platform ActionScript Language Reference.

Note: In ActionScript 3.0, there
is no equivalent to the ActionScript 2.0 _lockroot property.

References to root, when available, always reflect the
top-most display object in the portion of the display list’s tree structure
represented by that SWF file. (For images, root references the Bitmap
object.)

Note: There are no levels when
dealing with ActionScript 3.0.

Script:
var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest = new URLRequest(“myExternalMovie.swf”); myLoader.load(url);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s