Flash Player 7.
my_mcl.getProgress(target_mc:Object): Object
target_mc A SWF or JPEG file that is loaded using MovieClipLoader.loadClip().
An object that has two integer properties: bytesLoaded and bytesTotal.
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 MovieClipLoader.onLoadProgress listener function.
The following example loads an image into a draggable, dynamically created movie clip called image_mc. The number of bytes loaded and the total number of bytes for the loaded image display in a dynamically created text field called filesize_txt.
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);
MovieClipLoader.onLoadProgress
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001576.html
Comments
InternetInfinity said on Oct 18, 2004 at 3:10 PM :