Got a request?
Email us...

ActionScript Reference crumb.gif Movie Clip Control crumb.gif MovieClipLoader.onLoadComplete()

MovieClipLoader.onLoadComplete()

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);

REFERENCE SEARCH


RELATED ENTRIES

...ader.getProgress()
...ader.addListener()
...oader.unloadClip()
...pLoader.loadClip()
...ieClipLoader class

LINK TO US