|
ActionScript Reference Movie Clip Control
MovieClipLoader class
MovieClipLoader class
Entry Owner: Jen deHaan, Started: November 12, 2003
Availability:
Flash Player 7
Usage:
new MovieClipLoader();
Description:
The MovieClipLoader class allows you to easily load in external SWF or JPEG files into a Flash movie at runtime using listener callbacks. This fixes many problems which existed when loading documents into Flash in previous versions of the program.
The MovieClipLoader class handles the following four events:
- onLoadStart: called when the file has successfully started downloading.
- onLoadProgress: called repeatedly while the content is being downloaded.
- onLoadComplete: called when the content has finished loading.
- onLoadInit: called after the first few frames of the loaded clip have been executed.
By taking advantage of these four events you can easily load a new SWF or JPEG and build a preloader to monitor the load progress without having to resort to using either onEnterFrame or the setInterval method. If an error is encounted while trying to load an external file, Flash will invoke the onLoadError method.
Example:
The following code creates a new MovieClipLoader object which can be used to load an external SWF or JPEG.
var myLogo:MovieClipLoader = new MovieClipLoader();
|