User Guide
616 Chapter 6: Components Dictionary
Description
Property; the mode in which the progress bar loads content. This value can be "event",
"polled", or "manual".
Event mode and polled mode are the most common modes. In event mode, the
source property
specifies loading content that emits
progress and complete events; you should use a Loader
object in this mode. In polled mode, the
source property specifies loading content (such as a
MovieClip object) that exposes
getBytesLoaded() and getsBytesTotal() methods. Any
object that exposes these methods can be used as a source in polled mode (including a custom
object or the root Timeline).
You can also use the ProgressBar component in manual mode by manually setting the
maximum,
minimum, and indeterminate properties and making calls to the ProgressBar.setProgress()
method.
Example
The following code sets the progress bar to event mode. Drag an instance of the ProgressBar
component onto the Stage, and enter the instance name
my_pb in the Property inspector. Drag an
instance of the Loader component onto the Stage, and enter an instance name
my_ldr in the
Property inspector. Add the following code to Frame 1 of the Timeline:
var my_pb:mx.controls.ProgressBar;
var my_ldr:mx.controls.Loader;
var pbListener:Object = new Object();
pbListener.complete = function(evt:Object) {
evt.target._visible = false;
};
my_pb.addEventListener("complete", pbListener);
my_pb.mode = "polled";
my_pb.indeterminate = true;
my_pb.source = my_ldr;
my_ldr.autoLoad = false;
my_ldr.scaleContent = false;
my_ldr.load("http://www.macromedia.com/software/flex/images/
flex_presentation_eyes.jpg");
ProgressBar.percentComplete
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
pBarInstance.percentComplete