MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1023

Components language reference
Table of Contents

Advertisement

Example
The following example sets the progress bar mode to
the
onEnterFrame()
The example sets the minimum value for the progress bar to 100 and the maximum to 200
and marks the progress in increments of 1.
Drag an instance of the ProgressBar component onto the Stage, and enter the instance name
in the Property inspector. Add the following code to Frame 1 of the timeline:
my_pb
/**
Requires:
- ProgressBar 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;
}
};
function, which is invoked repeatedly at the frame rate of the SWF file.
and calls
manual
setProgress()
ProgressBar.setProgress()
from
1019

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents