ActionScript 2.0 Components Language Reference |
|
|
|
| ProgressBar component > ProgressBar.maximum | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
progressBarInstance.maximum
Property; the largest value for the progress bar when the ProgressBar.mode property is set to "manual".
The following example increments a ProgressBar component manually up to a maximum value of 200, at which point it stops. It displays the increment in the Output panel as the value increases.
Drag an instance of the ProgressBar component onto the Stage, and enter the instance name my_pb in the Property inspector. Add the following code to Frame 1 of the timeline:
/**
Requires:
- ProgressBar component on Stage (instance name: my_pb)
*/
var my_pb:mx.controls.ProgressBar;
//Set progress bar mode
my_pb.mode = "manual";
my_pb.label = "%1 out of %2 loaded";
//minimum numerical value before progress bar increments
my_pb.minimum = 100;
//maximum value of progress bar before it stops
my_pb.maximum = 200;
var increment_num:Number = my_pb.minimum;
this.onEnterFrame = function() {
if (increment_num < my_pb.maximum) {
increment_num++;
//update progress of number incrementing
my_pb.setProgress(increment_num, my_pb.maximum);
trace(increment_num);
} else {
delete this.onEnterFrame;
}
};
ProgressBar.minimum, ProgressBar.mode
|
|
|
|