MovieClipLoader.onLoadProgress
Availability
Flash Player 7.
Usage
listenerObject.onLoadProgress =
function([target_mc:Object [, loadedBytes:Number [, totalBytes:Number ] ] ]
) {
// your statements here
}
Parameters
listenerObject
A movie clip loaded by a
target_mc
optional.
loadedBytes
The total number of bytes in the file being loaded.
totalBytes
Returns
Nothing.
Description
Listener; invoked every time the loading content is written to disk during the loading process
(that is, between
You can use this method to display information about the progress of the download, using the
and
loadedBytes
The value for
target_mc
are loading multiple files with the same set of listeners. This optional parameter is passed to your
ActionScript.
Example
The following example creates a progress bar using the Drawing API. The progress bar displays
the loading progress of an image using the
loading, the progress bar is removed from the Stage. You must replace the URL parameter of the
image_mcl.loadClip()
If you attempt to use this example to load a local file that resides on your hard disk, this example
will not work properly because, in test movie mode, Flash Player loads local files in their entirety.
Add the following ActionScript to your FLA or AS file:
this.createEmptyMovieClip("progressBar_mc", 0);
progressBar_mc.createEmptyMovieClip("bar_mc", 1);
progressBar_mc.createEmptyMovieClip("stroke_mc", 2);
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0x000000);
moveTo(0, 0);
lineTo(100, 0);
A listener object that was added using MovieClipLoader.addListener().
The number of bytes that had been loaded when the listener was invoked.
MovieClipLoader.onLoadStart
parameters.
totalBytes
identifies the movie clip this call is being made for. This is useful if you
command so that the parameter refers to a valid JPEG file using HTTP.
MovieClipLoader.loadClip()
and
MovieClipLoader.onLoadComplete
onLoadProgress
MovieClipLoader.onLoadProgress
method. This parameter is
listener. When the image finishes
).
613
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?