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.
Summary of Contents for FLASH MX
Page 1: ...ActionScript Language Reference ...
Page 20: ...20 Contents ...
Page 24: ...24 Chapter 1 Introduction ...
Page 145: ...Button onKeyDown 145 See also Button onKeyUp ...
Page 202: ...202 Chapter 2 ActionScript Language Reference See also break default strict equality switch ...
Page 282: ...282 Chapter 2 ActionScript Language Reference See also break continue while ...
Page 383: ...LoadVars addRequestHeader 383 See also XML addRequestHeader ...
Page 388: ...388 Chapter 2 my_lv load place a valid URL pointing to a text file here ...
Page 463: ...Microphone setRate 463 See also Microphone rate ...
Page 469: ...Microphone silenceLevel 469 See also Microphone gain Microphone setSilenceLevel ...
Page 480: ...480 Chapter 2 ActionScript Language Reference See also Mouse addListener ...
Page 529: ...MovieClip globalToLocal 529 See also MovieClip getBounds MovieClip localToGlobal ...
Page 612: ...612 Chapter 2 ActionScript Language Reference See also MovieClipLoader onLoadStart ...
Page 623: ...NetConnection class 623 See also NetStream class Video attachVideo ...
Page 649: ...Number 649 See also NaN Number class ...
Page 679: ...on 679 on release trace X this _x trace Y this _y stopDrag See also onClipEvent ...
Page 683: ...onUpdate 683 buttonLabel textColor my_mc labelColor ...
Page 788: ...788 Chapter 2 ActionScript Language Reference See also private public ...
Page 1001: ...Video height 1001 my_mc _height my_mc my_video height See also MovieClip _height Video width ...
Page 1022: ...1022 Chapter 2 ActionScript Language Reference See also XML createElement ...
Page 1057: ...XML xmlDecl 1057 See also XML docTypeDecl XML toString ...
Page 1070: ...1070 Chapter 2 ActionScript Language Reference ...
Page 1104: ...1104 Appendix Deprecated Language Elements ...