Using ActionScript 3.0 Components |
|
|
|
| Customizing the UI Components > Customizing the Button > Using styles with the Button | |||
A Button's styles generally specify values for a Button's skins, icons, text formatting, and padding when the component is drawn in its various states.
The following procedure puts two Buttons on the Stage and sets the emphasized property to true for both Buttons when the user clicks one of them. It also sets the emphasizedSkin style for the second Button to the selectedOverSkin style when the user clicks it so the two Buttons show different skins for the same state.
To change the emphasizedSkin style for a Button:
bBtn.emphasized = true;
aBtn.emphasized = true;
bBtn.addEventListener(MouseEvent.CLICK, Btn_handler);
function Btn_handler(evt:MouseEvent):void {
bBtn.setStyle("emphasizedSkin", "Button_selectedOverSkin");
}
emphasizedSkin style on each button.
|
|
|
|