About loading and working with
external media
You can load several types of media files into a Flash application at runtime: SWF, MP3,
JPEG, GIF, PNG, and FLV files. However, not all versions of Flash Player support each kind
of media. For more information on the image file types that are supported in Macromedia
Flash Player 8, see
"Loading external SWF and image files" on page
FLV video support in Flash Player, see
Macromedia Flash Player can load external media from any HTTP or FTP address, from a
local disk using a relative path, or by using the
To load external SWF and image files, you can use the
function, the
MovieClip.loadMovie()
method. The class methods generally provide more function and flexibility than global
functions and are appropriate for more complex applications. When you load a SWF or image
file, you specify a movie clip or SWF file level as the target for that media. For more
information on loading SWF and image files, see
on page
593.
To play back an external MP3 file, use the
method lets you specify whether the MP3 file should progressively download or complete
downloading before it starts to play. You can also read the ID3 information embedded in
MP3 files, if they're available. For more information, see
on page
601.
Flash Video is the native video format used by Flash Player. You can play FLV files over
HTTP or from a local file system. Playing external FLV files provides several advantages over
embedding video in a Flash document, such as better performance and memory management
as well as independent video and Flash frame rates. For more information, see
external FLV files dynamically" on page
You can also preload or track the downloading progress of external media. Flash Player 7
introduced the MovieClipLoader class, which you can use to track the downloading progress
of SWF or image files. To preload MP3 and FLV files, you can use the
method of the Sound class and the
information, see
"Preloading FLV files" on page
You can find samples of photo gallery applications on your hard disk.These files provide
examples of how to use ActionScript to control movie clips dynamically while loading image
files into a SWF file. You can find gallery_tree.fla and gallery_tween.fla, the sample source
files, in the Samples folder on your hard disk.
592
Working with Images, Sound, and Video
"About using FLV video" on page 603
file://
loadMovie()
method, or the
"Loading external SWF and image files"
loadSound()
606.
property of the NetStream class. For more
bytesLoaded
609.
593. For information on
protocol.
or
loadMovieNum()
MovieClipLoader.loadClip()
method of the Sound class. This
"Reading ID3 tags in MP3 files"
getBytesLoaded()
"Playing back
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?