To create an application with the ProgressBar component in polled mode:
Drag a ProgressBar component from the Components panel to the Stage.
1.
In the Property inspector, do the following:
2.
Enter the instance name pBar.
Select Polled for the mode parameter.
Enter loader for the source parameter.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code, which
3.
creates a Sound object called
object:
var loader:Object = new Sound();
loader.loadSound("http://soundamerica.com/sounds/sound_fx/A-E/air.wav",
true);
In the following example, the progress bar is used in manual mode. In manual mode, you must set
the
,
maximum
minimum
method to display progress. You do not set the
To create an application with the ProgressBar component in manual mode:
Drag a ProgressBar component from the Components panel to the Stage.
1.
In the Property inspector, do the following:
2.
Enter the instance name pBar.
Select Manual for the mode parameter.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code, which
3.
updates the progress bar manually on every file download by using calls to
for(var:Number i=1; i <= total; i++){
// insert code to load file
pBar.setProgress(i, total);
}
Customizing the ProgressBar component
You can transform a ProgressBar component horizontally while authoring and at runtime. While
authoring, select the component on the Stage and use the Free Transform tool or any of the
Modify > Transform commands. At runtime, use
The progress bar's left cap, right cap, and track graphic are set at a fixed size. When you resize a
progress bar, its middle portion is resized to fit between the two caps. If a progress bar is too small,
it may not render correctly.
Using styles with the ProgressBar component
You can set style properties to change the appearance of a progress bar instance. If the name of a
style property ends in "Color", it is a color style property and behaves differently than noncolor
style properties. For more information, see
on page
67.
and calls
loader
, and
indeterminate
"Using styles to customize component color and text"
to load a sound into the Sound
loadSound()
properties in conjunction with the
property in manual mode.
source
UIObject.setSize()
setProgress()
setProgress()
.
ProgressBar component
:
605
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers