Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Working with Movie Clips > Loading and unloading SWF files | |||
To play additional SWF files without closing Flash Player, or to switch SWF files without loading another HTML page, you can use one of the following options:
loadMovie() function or loadMovie() method of the MovieClip class. loadClip() method of the MovieClipLoader class. For more information on the MovieClipLoader class, see MovieClipLoader in the ActionScript 2.0 Language Reference. You can also use the loadMovie() method to send variables to a CGI script, which generates a SWF file as its CGI output. For example, you might use this procedure to load dynamic SWF or image files based on specified variables within a movie clip. When you load a SWF file, you can specify a level or movie clip target into which the SWF file loads. If you load a SWF file into a target, the loaded SWF file inherits the properties of the targeted movie clip. After the Flash movie is loaded, you can change those properties.
The unloadMovie() method removes a SWF file previously loaded by the loadMovie() method. Explicitly unloading SWF files with unloadMovie() ensures a smooth transition between SWF files and can decrease the memory that Flash Player requires. It can be more efficient in some situations to set the movie clip's _visible property to false instead of unloading the clip. If you might reuse the clip at a later time, set the _visible property to false and then set to true when necessary.
Use loadMovie() to do any of the following:
loadMovie() function in a container SWF file that sequentially loads and unloads SWF banner files.For more information on loading SWF files, see Loading external SWF and image files.
For more information, see the following topics:
|
|
|
|