K-L > loadMovie
loadMovieSyntax
loadMovie(
url
[,location
/
target
,
variables
]]);
Arguments
url
An absolute or relative URL for the SWF file to load. A relative path must be relative to the SWF. 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-movie mode in the Flash authoring environment, all SWF files must be stored in the same folder, and the file names cannot include folder or disk drive specifications.
target
An optional argument specifying a target movie clip that will be replaced by the loaded movie. The loaded movie inherits the position, rotation, and scale properties of the targeted movie clip. Specifying a target
is the same as specifying the location
(level) of a target movie; you should not specify both.
location
An optional argument specifying the level into which the movie is loaded. The loaded movie inherits the position, rotation, and scale properties of the targeted movie clip. To load the new movie in addition to existing movies, specify a level that is not occupied by another movie. To replace an existing movie with the loaded movie, specify a level that is currently occupied by another movie. To replace the original movie and unload every level, load the new movie into level 0. The movie in level 0 sets the frame rate, background color, and frame size for all other loaded movies.
variables
An optional argument specifying a method for sending variables associated with the movie to load. The argument must be the string "GET" or "POST." If there are no variables, omit this argument; otherwise, specify whether to load variables using a GET
or POST
method. GET
appends the variables to the end of the URL, and is used for small numbers of variables. POST
sends the variables in a separate HTTP header and is used for long strings of variables.
Description
Action; plays additional movies without closing the Flash Player. Normally, the Flash Player displays a single Flash Player movie (SWF file) and then closes. The loadMovie
action lets you display several movies at once or switch between movies without loading another HTML document.
You can load movies into level that already have SWF files loaded. If you do, the new movie will replace the existing SWF file. If you load a new movie into Level 0, every level is unloaded, and Level 0 is replaced with the new file. Use the loadVariables
action to keep the active movie, and update the variables with new values.
Use the unloadMovie
action to remove movies loaded with the loadMovie
action.
Player
Flash 3 or later.
Example
This 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); }
See also
unloadMovie
_level