Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Images, Sound, and Video > 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 Flash Player 8 and later, see Loading external SWF and image files. For information on FLV video support in Flash Player, see About using FLV video
Flash Player can load external media from any HTTP or FTP address, from a local disk using a relative path, or by using the file:// protocol.
To load external SWF and image files, you can use the loadMovie() or loadMovieNum() function, the MovieClip.loadMovie() method, or the MovieClipLoader.loadClip() 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 Loading external SWF and image files.
To play back an external MP3 file, use the loadSound() method of the Sound class. This 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 Reading ID3 tags in MP3 files.
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 Playing back external FLV files dynamically.
You can also preload or track the downloading progress of external media with 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 getBytesLoaded() method of the Sound class and the bytesLoaded property of the NetStream class. For more information, see Preloading FLV files.
For samples of photo gallery applications, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download the Samples zip file and navigate to the ActionScript2.0/Galleries to access these samples:
These files provide examples of how to use ActionScript to control movie clips dynamically while loading image files into a SWF file.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001024.html