EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Onloadstart (Moviecliploader.onloadstart Event Listener)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
958 ActionScript classes
totalBytes:Number - The total number of bytes in the file being loaded.
Example
The following example creates a movie clip, a new
MovieClipLoader instance, and an
anonymous event listener. It periodically outputs the progress of a load and finally provides
notification when the load is complete and the asset is available to ActionScript.
var container:MovieClip = this.createEmptyMovieClip("container",
this.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number,
bytesTotal:Number):Void {
trace(target + ".onLoadProgress with " + bytesLoaded + " bytes of " +
bytesTotal);
}
listener.onLoadInit = function(target:MovieClip):Void {
trace(target + ".onLoadInit");
}
mcLoader.addListener(listener);
mcLoader.loadClip("http://www.w3.org/Icons/w3c_main.png", container);
If your SWF file includes a version 2 component, use the version 2 component's
DepthManager class instead of the
MovieClip.getNextHighestDepth() method, which is
used in this example.
See also
addListener (MovieClipLoader.addListener method), loadClip
(MovieClipLoader.loadClip method)
, getProgress (MovieClipLoader.getProgress
method)
onLoadStart (MovieClipLoader.onLoadStart event
listener)
onLoadStart = function([target_mc:MovieClip]) {}
Invoked when a call to MovieClipLoader.loadClip() has begun to download a file. Call
this listener on a listener object that you add by using
MovieClipLoader.addListener().
The value for
target_mc identifies the movie clip for which this call is being made. This
parameter is useful if you are loading multiple files with the same set of listeners.
Availability: ActionScript 1.0; Flash Player 7

Table of Contents

Related product manuals