User Guide
538 Chapter 2: ActionScript Language Reference
MovieClip.loadMovie()
Availability
Flash Player 5.
Usage
my_mc.loadMovie(url:String [,variables:String]) : Void
Parameters
url
The absolute or relative URL of the SWF file or JPEG file to be loaded. A relative path
must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference,
such as http:// or file:///.
variables An optional parameter specifying an HTTP method for sending or loading
variables. The parameter must be the string
GET or POST. If there are no variables to be sent, omit
this parameter. The
GET method appends the variables to the end of the URL and is used for small
numbers of variables. The
POST method sends the variables in a separate HTTP header and is
used for long strings of variables.
Returns
Nothing.
Description
Method; loads SWF or JPEG files into a movie clip in Flash Player while the original SWF file
is playing.
Tip: If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of
this function.
Without the loadMovie() method, Flash Player displays a single SWF file and then closes. The
loadMovie() method lets you display several SWF files at once and switch between SWF files
without loading another HTML document.
A SWF file or image loaded into a movie clip inherits the position, rotation, and scale properties
of the movie clip. You can use the target path of the movie clip to target the loaded SWF file.
When calling
loadMovie(), set the MovieClip._lockroot property to true in the loader
movie, as shown in the following code. If you don’t set
_lockroot to true in the loader movie,
the loader has access only to its own library, but not the library in the loaded movie:
myMovieClip._lockroot = true;
Use the MovieClip.unloadMovie() method to remove SWF files or images loaded with the
loadMovie() method. Use the MovieClip.loadVariables() method to keep the active SWF
file, and update the variables of the SWF file with new values.