Hands-On: Flash MX 2004 Adding a Progress Bar to a Movie
The ProgressBar component is a welcome addition to the MX 2004 edition.
If your movie takes a while to load, this component will show the progress of
the download by a moving bar and the percentage loaded. This could be used as
a Preloader by itself or in addition to a Preloader Movie you have created.
Exercise 39: Adding a ProgressBar Component to a Movie
- Open the Components panel.
- Click the UI Components expand plus mark [+] to open its contents.
Drag
the ProgressBar component onto the Stage.
- Select the new ProgressBar component with the mouse.
Give
the ProgressBar component a unique instance name in the Properties Inspector.
(myBar)
- Open the Component Inspector panel
In the
Parameters tab click the Mode list arrow, and then click Event.
- Drag
a Loader component from the Components panel onto the Stage.
- Give the Loader component a unique instance name in the Properties Inspector
(myLoader).

- Select the ProgressBar component on the Stage.
- Click the Parameters tab in the Component Inspector panel,
and then enter the instancename of the Loader into the value field
(myLoader).
- Select Frame 1 in the Timeline. (This may be the only frame you
have if this is a new exercise file.)
- Enter the script shown below from the Actions – Frame panel
that will load a .swf or .jpg file into the Loader component. (Enter
the file name of your own movie where you see my movie file name “crossfireNEW.swf”.)
- Click [Control] + [Enter] to check out your new ProgressBar in
action.
Note: You are not adding scripts to the components on the Stage; these components
are activated by scripts in Frame 1 on the Timeline, and are identified by using
unique instance names for each component.

|