User Guide
994 ProgressBar component
To create an application with the ProgressBar component in polled mode:
1. Drag a ProgressBar component from the Components panel to the Stage.
2. In the Property inspector, enter the instance name my_pb.
3. Select Frame 1 in the Timeline, open the Actions panel, and enter the following code,
which creates a Sound object called
my_sound and calls loadSound() to load a sound into
the Sound object:
/**
Requires:
- ProgressBar component on Stage (instance name: my_pb)
*/
System.security.allowDomain("http://www.helpexamples.com");
var my_pb:mx.controls.ProgressBar;
my_pb.mode = "polled";
my_pb.source = "my_sound";
var pbListener:Object = new Object();
pbListener.complete = function(evt_obj:Object) {
trace("Sound loaded");
}
my_pb.addEventListener("complete", pbListener);
var my_sound:Sound = new Sound();
my_sound.loadSound("http://www.helpexamples.com/flash/sound/disco.mp3",
true);
In the following example, the progress bar is used in manual mode. In manual mode, you
must set the
maximum, minimum, and indeterminate properties in conjunction with the
setProgress() method to display progress. You do not set the source property in
manual mode.