|
ActionScript Reference Movie Clip Control
MovieClipLoader.onLoadComplete()
MovieClipLoader.onLoadComplete()
Entry Owner: Jen deHaan, Started: November 12, 2003
Availability:
Flash Player 7
Usage:
listenerObject.onLoadComplete = function ( target_mc ) { ... }
Description:
The onLoadComplete Listener is triggered when a SWF or JPEG has been finished loading. This enables you to hide any preloaders or position the movie clip on the Stage.
Example:
The following bit of fancy code loads in an image and uses a ProgressBar component to display the loading progress to the user. During the loading process the onLoadProgress function is called and updates the ProgressBar's progess. After the loading process is complete the onLoadComplete function is called and hides the ProgressBar component instance on the Stage by setting the _visible property to false.
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
var myImage:MovieClipLoader = new MovieClipLoader();
var listenerObject:Object = new Object();
listenerObject.onLoadComplete = function() {
progressBar_pb._visible = false;
};
listenerObject.onLoadProgress = function() {
var stats:Object = myImage.getProgress(logo_mc);
progressBar_pb.setProgress(stats.bytesLoaded, stats.bytesTotal);
};
myImage.addListener(listenerObject);
myImage.loadClip("talkinggoat.jpg", logo_mc);
|