Using ActionScript 3.0 Components |
|
|
|
| Customizing the UI Components > Customizing the RadioButton > Using styles with the RadioButton | |||
You can set style properties to change the appearance of a RadioButton. The ScrollPane's style properties specify values for its skins, icons, text formatting, and padding when the component is drawn. The ScrollPane's styles specify values for its skins and padding for its layout when the component is drawn.
The following example retrieves the textFormat style from a CheckBox component and applies it to a RadioButton to make the style of their labels identical.
To apply the textFormat style from a CheckBox to a RadioButton:var tf:TextFormat = new TextFormat();tf.color = 0x00FF00;tf.font = "Georgia";tf.size = 18;myCh.setStyle("textFormat", tf);myRb.setStyle("textFormat", myCh.getStyle("textFormat"));
This code sets the textFormat style for the CheckBox, then applies it to the RadioButton by calling the getStyle() method on the CheckBox.
|
|
|
|