Flash Video (FLV) is the native video format used by Flash Player. You can play back FLV files
over HTTP, or from the local file system. Playing external FLV files provides several advantages
over embedding video in a Flash document, such as better performance and memory
management, and independent video and Flash frame rates. For more information, see
back external FLV files dynamically" on page
You can also preload, or track the download progress, of external media. Flash Player 7 introduces
the MovieClipLoader class, which you can use to track the download progress of SWF or JPEG
files. To preload MP3 and FLV files, you can use the
class and the
bytesLoaded
"Preloading external media" on page
Loading external SWF and JPEG files
To load a SWF or JPEG file, use the
method of the MovieClip class. To load a SWF or JPEG file into a level in Flash
loadMovie()
Player, use
loadMovieNum()
function or method. In either case, the loaded content replaces the content of the
loadMovie()
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
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
clip as a parameter. For example, the following code loads the Flash application contents.swf into
the movie clip instance named
loadMovieNum("contents.swf", target_mc);
Equivalently, you can use
target_mc.loadMovie("contents.swf");
The following code loads the JPEG image flowers.jpg into the movie clip instance
image_clip.loadMovie("flowers.jpg");
For more information about
their entries in
Chapter 12, "ActionScript Dictionary," on page
194
Chapter 11: Working with External Media
197.
property of the NetStream class. For more information, see
198.
loadMovie()
. To load a SWF or JPEG file into a movie clip target, use the
or
loadMovie()
loadMovieNum(
:
target_mc
MovieClip.loadMovie()
,
loadMovie()
loadMovieNum()
getBytesLoaded()
or
global function, or the
loadMovieNum()
or
loadMovie()
loadMovieNum()
) function, specify the target level or
to achieve the same result:
, and
MovieClip.loadMovie()
205.
"Playing
method of the Sound
call.
:
image_clip
, see
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers