In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\Galleries.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Galleries.
Loading external SWF and image files
To load a SWF or image file, use the
method of the MovieClip class, or the
loadMovie()
MovieClipLoader class. For more information on the
MovieClipLoader.loadClip()
For image files, Flash Player 8 supports the JPEG (progressive and non-progressive) image file
type, GIF images (transparent and non-transparent, although only the first frame of an
animated GIF will be loaded), and PNG files (transparent and non-transparent).
To load a SWF or image file into a level in Flash Player, use the
To load a SWF or image file into a movie clip target, use the
method. In either case, the loaded content replaces the content of the specified level or target
movie clip.
When you load a SWF or image file into a movie clip target, the upper-left corner of the SWF
file or 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 might not appear centered.
Also, when you load a SWF file or 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
This is useful, for example, if the URL you're specifying in the method call is a server-side
script that returns a SWF or image file according to data passed from the Flash application.
When you use the global
or clip as a parameter. The following example loads the Flash application contents.swf into the
movie clip instance named
loadMovie("contents.swf", image_mc);
You can use
MovieClip.loadMovie()
image_mc.loadMovie("contents.swf");
The following example loads the image1.jpg JPEG image into the
instance:
image_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg");
loadMovie()
in the ActionScript 2.0 Language Reference.
or
loadMovie()
loadMovieNum()
:
image_mc
to achieve the same result:
or
loadMovieNum()
method of the
loadClip()
method, see
loadClip()
loadMovieNum()
loadMovie()
or
loadMovie()
loadMovieNum()
function, specify the target level
image_mc
Loading external SWF and image files
global function, the
function.
function or
call.
movie clip
593
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?