User Guide
ProgressBar component 603
ProgressBar component
The ProgressBar component displays the progress of loading content. The loading process can be
determinate or indeterminate. A determinate progress bar is a linear representation of a task’s
progress over time and is used when the amount of content to load is known. An indeterminate
progress bar is used when the amount of content to load is unknown. You can add a label to
display the progress of the loading content.
By default, components are set to export in the first frame. This means that components are
loaded into an application before the first frame is rendered. If you want to create a preloader for
an application, you must deselect Export in First Frame in each component’s Linkage Properties
dialog box (available from the Library options menu). The progress bar, however, should be set to
Export in First Frame, because it must appear first, while other content streams into Flash Player.
The ProgressBar component contains a left cap, a right cap, and a progress track. The caps are
simply the ends of the progress bar, where the progress track visually ends. A live preview of each
ProgressBar instance reflects changes made to parameters in the Property inspector or Component
inspector during authoring. The following parameters are reflected in the live preview:
conversion, direction, label, labelPlacement, mode, and source.
Using the ProgressBar component
A progress bar lets you display the progress of content as it loads. This is essential feedback for
users as they interact with an application.
There are several modes in which to use the ProgressBar component; you set the mode with the
mode parameter. The most commonly used modes are event mode and polled mode. These
modes use the source parameter to specify a loading process that either emits
progress and
complete events (event mode), or exposes getBytesLoaded() and getsBytesTotal() methods
(polled mode). You can also use the ProgressBar component in manual mode by manually setting
the
maximum, minimum, and indeterminate properties along with calls to the
ProgressBar.setProgress() method.
ProgressBar parameters
You can set the following authoring parameters for each ProgressBar instance in the Property
inspector or in the Component inspector:
mode is the mode in which the progress bar operates. This value can be one of the following:
event, polled, or manual. The default value is event.
source is a string to be converted into an object representing the instance name of the source.
direction indicates the direction toward which the progress bar fills. This value can be right or
left; the default value is right.
label is the text indicating the loading progress. This parameter is a string in the format "%1 out
of %2 loaded (%3%%)". In this string, %1 is a placeholder for the current bytes loaded, %2 is a
placeholder for the total bytes loaded, and %3 is a placeholder for the percent of content loaded.
The characters “%%” are a placeholder for the “%” character. If a value for %2 is unknown, it is
replaced by two question marks (??). If a value is undefined, the label doesn’t display.
CHAPTER 6
Components Dictionary