User Guide
490 Chapter 6: Components Dictionary
Description
Property (read-only); the number of bytes of content that have been loaded. The default value is 0
until content begins loading.
Example
The following code creates a progress bar and a Loader component. It then creates a listener
object with a
progress event handler that shows the progress of the load. The listener is
registered with the
loader instance.
createClassObject(mx.controls.ProgressBar, "pBar", 0);
createClassObject(mx.controls.Loader, "loader", 1);
loadListener = new Object();
loadListener.progress = function(eventObj){
// eventObj.target is the component that generated the progress event,
// that is, the loader
pBar.setProgress(loader.bytesLoaded, loader.bytesTotal); // show progress
}
loader.addEventListener("progress", loadListener);
loader.content = "logo.swf";
When you create an instance with createClassObject(), you have to position it on the Stage
with
move() and setSize(). See UIObject.move() and UIObject.setSize().
See also
Loader.bytesTotal
, UIObject.createClassObject()
Loader.bytesTotal
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
loaderInstance.bytesTotal
Description
Property (read-only); the size of the content, in bytes. The default value is 0 until content
begins loading.
Example
The following code creates a progress bar and a Loader component. It then creates a load listener
object with a
progress event handler that shows the progress of the load. The listener is
registered with the loader instance, as follows:
createClassObject(mx.controls.ProgressBar, "pBar", 0);
createClassObject(mx.controls.Loader, "loader", 1);
loadListener = new Object();
loadListener.progress = function(eventObj){