ActionScript 2.0 Components Language Reference |
|
|
|
| ProgressBar component > ProgressBar.labelPlacement | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
progressBarInstance.labelPlacement
Property; sets the placement of the label in relation to the progress bar. The possible values are "left", "right", "top", "bottom", and "center".
The following example loads an image into a loader and marks the progress with a progress bar. It sets the labelPlacement property to top to place the label above the progress bar.
You must first drag a Loader component and a ProgressBar component from the Components panel to the current document's library; then add the following code to Frame 1 of the main timeline:
/**
Requires:
- ProgressBar component in library
- Loader component in library
*/
System.security.allowDomain("http://www.helpexamples.com");
this.createClassObject(mx.controls.ProgressBar, "my_pb", 10);
this.createClassObject(mx.controls.Loader, "my_ldr", 20);
my_ldr.move(0, 30);
// Set progress bar settings
my_pb.mode = "polled";
my_pb.source = my_ldr;
my_pb.label = "%1 of %2 KB loaded";
my_pb.conversion = 1024; // 1024 bytes in a KB
my_pb.labelPlacement = "top";
// Set loader settings
my_ldr.autoLoad = false;
my_ldr.scaleContent = false;
my_ldr.load("http://www.helpexamples.com/flash/images/image1.jpg");
|
|
|
|