User Guide
ProgressBar component 617
Description
Property (read-only); tells what percentage of the content has been loaded. This value is floored.
(The floor is the closest integer value that is less than or equal to the specified value. For example,
the number 7.8 becomes 7.) The following formula is used to calculate the percentage:
100*(value-minimum)/(maximum-minimum)
Example
The following code sends the value of the percentComplete property to the Output panel:
trace("percent complete = " + pBar.percentComplete);
ProgressBar.progress
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
Usage 1:
on(progress){
...
}
Usage 2:
listenerObject = new Object();
listenerObject.progress = function(eventObject){
...
}
pBarInstance.addEventListener("progress", listenerObject)
Event object
In addition to the standard event object properties, there are two additional properties defined
for the
ProgressBar.progress event: current (the loaded value equals total), and total (the
total value).
Description
Event; broadcast to all registered listeners whenever the value of a progress bar changes. This event
is broadcast only when
ProgressBar.mode is set to "manual" or "polled".
The first usage example uses an
on() handler and must be attached directly to a ProgressBar
instance. The keyword
this, used inside an on() handler attached to a component, refers to the
component instance. For example, the following code, attached to the instance
myPBar, sends
“_level0.myPBar” to the Output panel:
on(progress){
trace(this);
}