The following example shows how you can create an indeterminate Flash/ActionScript 3.0 ProgressBar control by setting the Boolean indeterminate property.

Full code after the jump.

// ActionScript 3.0
/* Requires:
 * - CheckBox control in Library
 * - ProgressBar control in Library
 */
import fl.controls.ButtonLabelPlacement;
import fl.controls.CheckBox;
import fl.controls.ProgressBar;
import fl.controls.ProgressBarMode;
 
var checkBox:CheckBox = new CheckBox();
checkBox.label = "indeterminate:";
checkBox.labelPlacement = ButtonLabelPlacement.LEFT;
checkBox.move(10, 10);
checkBox.addEventListener(Event.CHANGE, checkBox_change);
addChild(checkBox);
 
var progressBar:ProgressBar = new ProgressBar();
progressBar.indeterminate = checkBox.selected;
progressBar.setSize(300, 100);
progressBar.move(100, 100);
addChild(progressBar);
 
function checkBox_change(evt:Event):void {
    progressBar.indeterminate = checkBox.selected;
}
Tagged with:
 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam Protection by WP-SpamFree