labelPlacement
can be one of the following values:
conversion
is a number by which to divide the %1 and %2 values in the label string before they
are displayed. The default value is 1.
You can write ActionScript to control these and additional options for the ProgressBar
component using its properties, methods, and events. For more information, see
class" on page
607.
Creating an application with the ProgressBar component
The following procedure explains how to add a ProgressBar component to an application while
authoring. In this example, the progress bar is used in event mode. In event mode, the loading
content must emit
(These events are emitted by the Loader component. For more information, see
component" on page
To create an application with the ProgressBar component in event 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 Event for the mode parameter.
Drag a Loader component from the Components panel to the Stage.
3.
In the Property inspector, enter the instance name loader.
4.
Select the progress bar on the Stage and, in the Property inspector, enter loader for the
5.
source parameter.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code, which
6.
loads a JPEG file into the Loader component:
loader.autoLoad = false;
loader.contentPath = "http://imagecache2.allposters.com/images/86/
017_PP0240.jpg";
pBar.source = loader;
// loading does not start until load() is invoked
loader.load();
In the following example, the progress bar is used in polled mode. In polled mode, the
ProgressBar uses the
display its progress.
604
Chapter 6: Components Dictionary
indicates the position of the label in relation to the progress bar. This parameter
,
top
and
progress
complete
484.)
getBytesLoaded()
,
,
,
bottom
left
right
center
events that the progress bar uses to display progress.
and
getBytesTotal()
. The default value is
"ProgressBar
"Loader
methods of the source object to
.
bottom
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