Getprogress (Moviecliploader.getprogress Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

getProgress (MovieClipLoader.getProgress method)

public getProgress(target:Object) : Object
Returns the number of bytes loaded and total number of bytes for a file that is being loaded
by using
MovieClipLoader.loadClip()
reflects the number of compressed bytes. The
this information, instead of (or in addition to) writing a
listener function.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A SWF, JPEG, GIF, or PNG file that is loaded using
target:Object
MovieClipLoader.loadClip()
Returns
- An object that has two integer properties:
Object
Example
The following example demonstrates usage of the
this method, one will usually create a listener object and listen for the
Another important note about this method, is that the first, synchronous call to getProgress
can return the bytesLoaded and bytesTotal of the container and not the values for the
externally requested object.
var container:MovieClip = this.createEmptyMovieClip("container",
this.getNextHighestDepth());
var image:MovieClip = container.createEmptyMovieClip("image",
container.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);
}
mcLoader.addListener(listener);
mcLoader.loadClip("http://www.w3.org/Icons/w3c_main.png", image);
var interval:Object = new Object();
interval.id = setInterval(checkProgress, 100, mcLoader, image, interval);
function checkProgress(mcLoader:MovieClipLoader, image:MovieClip,
interval:Object):Void {
532
ActionScript classes
; for compressed movies, the
getProgress
.
bytesLoaded
getProgress
getProgress
method lets you explicitly request
MovieClipLoader.onLoadProgress
and
bytesTotal
method. Rather than using
onLoadProgress
method
.
event.

Advertisement

Table of Contents
loading

Table of Contents