MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1026

Components language reference
Table of Contents

Advertisement

Description
Property (read-only); indicates the amount of progress that has been made. This property is a
number between the value of
default value is 0.
Example
The following example loads an image into a Loader component and marks the progress with
the a progress bar. When the loading is complete, the example displays the minimum,
maximum, and current values for the progress bar.
Drag an instance of the ProgressBar component onto the Stage, and enter the instance name
in the Property inspector. Drag an instance of the Loader component onto the Stage,
my_pb
and enter the instance name
Frame 1 of the timeline:
/**
Requires:
- Loader component instance on Stage (instance name: my_ldr)
- Progress component instance on Stage (instance name: my_pb)
*/
System.security.allowDomain("http://www.helpexamples.com");
var my_ldr:mx.controls.Loader;
var my_pb:mx.controls.ProgressBar;
my_pb.mode = "polled";
my_pb.source = my_ldr;
my_ldr.autoLoad = false;
//Create Listener Object
var pbListener:Object = new Object();
pbListener.complete = function(evt_obj:Object){
// event_obj.target is the component that generated the complete event,
// i.e., the progress bar.
trace("Minimum value is: " + evt_obj.target.minimum + " bytes");
trace("Maximum value is: " + evt_obj.target.maximum + " bytes");
trace("Current ProgressBar value = " + evt_obj.target.value + " bytes");
}
//Add Listener
my_pb.addEventListener("complete", pbListener);
// when autoLoad is false loading does not start until load() is invoked
my_ldr.load("http://www.helpexamples.com/flash/images/image1.jpg");
1022
ProgressBar component
ProgressBar.minimum
in the Property inspector. Add the following code to
my_ldr
and
ProgressBar.maximum
. The

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents