MovieClipLoader.getProgress()
Availability
Flash Player 7.
Usage
my_mcl.getProgress(target_mc:Object) : Object
Parameters
A SWF or JPEG file that is loaded using MovieClipLoader.loadClip().
target_mc
Returns
An object that has two integer properties:
Description
Method; returns the number of bytes loaded and total number of bytes for a file that is being
loaded using MovieClipLoader.loadClip(); for compressed movies, it reflects the number of
compressed bytes. This method lets you explicitly request this information, instead of (or in
addition to) writing a
Example
The following example loads an image into a draggable, dynamically created movie clip called
. The number of bytes loaded and the total number of bytes for the loaded image
image_mc
display in a dynamically created text field called
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.onPress = function() {
this.startDrag();
};
target_mc.onRelease = function() {
this.stopDrag();
};
var mclProgress:Object = image_mcl.getProgress(target_mc);
target_mc.createTextField("filesize_txt", target_mc.getNextHighestDepth(),
0, target_mc._height, target_mc._width, 22);
target_mc.filesize_txt.text = mclProgress.bytesLoaded+" of
"+mclProgress.bytesTotal+" bytes loaded";
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.macromedia.com/images/shared/product_boxes/
112x112/box_studio_112x112.jpg", image_mc);
See also
MovieClipLoader.onLoadProgress
bytesLoaded
MovieClipLoader.onLoadProgress
and
bytesTotal
listener function.
.
filesize_txt
MovieClipLoader.getProgress()
.
603
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?