![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
To load a SWF or JPEG file, use the loadMovie()
or loadMovieNum()
global function, or the loadMovie()
method of the MovieClip class. To load a SWF or JPEG file into a level in Flash Player, use loadMovieNum()
. To load a SWF or JPEG file into a movie clip target, use the loadMovie()
function or method. In either case, the loaded content replaces the content of the specified level or target movie clip.
When you load a SWF or JPEG file into a movie clip target, the upper left corner of the SWF file or JPEG image is placed on the registration point of the movie clip. Because this registration point is often the center of the movie clip, the loaded content may not appear centered. Also, when you load a SWF file or JPEG image to a root Timeline, the upper left corner of the image is placed on the upper left corner of the Stage. The loaded content inherits rotation and scaling from the movie clip, but the original content of the movie clip is removed.
You can optionally send ActionScript variables with a loadMovie()
or loadMovieNum()
call. This is useful, for example, if the URL you're specifying in the method call is a server-side script that returns a JPEG or SWF file according to data passed from the Flash application.
For image files, Flash supports only the standard JPEG image file type, not progressive JPEG files.
When you use the global loadMovie()
or loadMovieNum(
) function, specify the target level or clip as a parameter. For example, the following code loads the Flash application contents.swf into the movie clip instance named target_mc
:
loadMovieNum("contents.swf", target_mc);
Equivalently, you can use MovieClip.loadMovie()
to achieve the same result:
target_mc.loadMovie("contents.swf");
The following code loads the JPEG image flowers.jpg into the movie clip instance image_clip
:
image_clip.loadMovie("flowers.jpg");
For more information about these methods, see loadMovie()
, loadMovieNum()
, and MovieClip.loadMovie()
.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |