630 Working with Images, Sound, and Video
Creating a progress bar for loading FLV files with
ActionScript
You can create a progress bar to display the loading progress of an FLV file. For information
on loading FLV files into a SWF file, see “Preloading FLV files” on page 609. For other
information about FLV files and Flash, see “About using FLV video” on page 603.
The following example uses the Drawing API to create a progress bar. The example also uses
the
bytesLoaded and bytesTotal properties to show the loading progress of video1.flv into
the video object instance called
my_video. The loaded_txt text field is dynamically created
to show information about the loading progress.
To create a progress bar that shows loading progress:
1. Create a new FLA file called flvProgress.fla.
2. In the Library panel (Window > Library), select New Video from the Library
pop-up menu.
3. In the Video Properties dialog box, name the video symbol and select Video (ActionScript
controlled).
4. Click OK to create a video object.
5. Drag the video object from the Library panel to the Stage to create a video object instance.
6. With the video object selected on the Stage, type my_video in the Instance Name text box
in the Property inspector (Window > Properties > Properties).
7. With the video instance selected, type 320 into the width text box and 213 into the height
text box.