User Guide
Button class 101
12. Repeat steps 2-11 and create green and blue skins, named accordingly.
13. Click the Back button to return to the main timeline.
14. Drag a Button component to the Stage.
15. Set the toggled property value to true to see all three skins.
16. Copy the following ActionScript code to the Actions panel with the Button instance
selected.
onClipEvent(initialize) {
falseUpSkin = "BlueButtonSkin";
falseDownSkin = "GreenButtonSkin";
falseOverSkin = "BlueButtonSkin";
falseDisabledSkin = "BlueButtonSkin";
trueUpSkin = "RedButtonSkin";
trueDownSkin = "RedButtonSkin";
trueOverSkin = "RedButtonSkin";
trueDisabledSkin = "RedButtonSkin";
}
17.
Select Control > Test Movie.
Button class
Inheritance MovieClip > UIObject class > UIComponent class > SimpleButton class >
Button
ActionScript Class Name mx.controls.Button
The properties of the Button class let you do the following at runtime: add an icon to a
button, create a text label, and indicate whether the button acts as a push button or as a
toggle switch.
Setting a property of the Button class with ActionScript overrides the parameter of the same
name set in the Property inspector or Component inspector.
The Button component uses the Focus Manager to override the default Flash Player focus
rectangle and draw a custom focus rectangle with rounded corners. For more information, see
“Creating custom focus navigation” in Using Components.