G-L > loadMovie |
![]() ![]() ![]() |
loadMovie
Availability
Flash Player 3.
Usage
loadMovie(
"url
",level
/
target
[,
variables
])
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. The URL must be in the same subdomain as the URL where the movie currently resides. For use in the Flash Player or for testing in test mode in the Flash authoring application, all SWF files must be stored in the same folder, and the filenames cannot include folder or disk drive specifications.
target
A path to a target movie clip. The target movie clip will be replaced by the loaded movie or image. You must specify either a target
movie clip or a level
of a target movie; you can't specify both.
level
An integer specifying the level in the Flash Player into which the movie will be loaded. When you load a movie or image into a level, the loadMovie
action in the Actions panel in normal mode switches to loadMovieNum
; in expert mode, you must specify loadMovieNum
or choose it from the Actions toolbox.
variables
An optional parameter specifying an HTTP method for sending 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
Action; load a SWF or JPEG file into the Flash Player while the original movie is playing. The loadMovie
action lets you display several movies at once and switch between movies without loading another HTML document. Without the loadMovie
action, the Flash Player displays a single movie (SWF file) and then closes.
When you use the loadMovie
action, you must specify either a level in the Flash Player or a target movie clip, into which the movie will load. If you specify a level, the action changes to loadMovieNum
. If a movie is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded movie.
A movie or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or movie aligns with the registration point of the targeted movie clip. Alternatively, if the target is the _root
Timeline, the upper left corner of the image or movie aligns with the upper left corner of the Stage.
Use the unloadMovie
action to remove movies loaded with the loadMovie
action.
Example
The following loadMovie
statement is attached to a navigation button labeled Products. There is an invisible movie clip on the Stage with the instance name dropZone.
The loadMovie
action uses this movie clip as the target parameter to load the products in the SWF file, into the correct position on the Stage.
on(release) { loadMovie("products.swf",_root.dropZone); }
The following example loads a JPEG image from the same directory as the SWF File that calls the loadMovie
action:
loadMovie("image45.jpeg", "ourMovieClip");
See also
loadMovieNum
, unloadMovie
, unloadMovieNum
,
_level
![]() ![]() ![]() |