Using ActionScript 2.0 Components |
|
|
|
| Customizing Components > Using styles to customize component color and text > Getting style property values | |||
To retrieve a style property value, use UIObject.getStyle() in ActionScript 2.0 Components Language Reference. Every component that is a subclass of UIObject (which includes all version 2 components except the Media components) inherits the getStyle() method. This means you can call getStyle() from any component instance, just as you can call setStyle() from any component instance.
The following code gets the value of the themeColor style and assigns it to the variable oldStyle:
var myCheckBox:mx.controls.CheckBox;
var oldFontSize:Number
oldFontSize = myCheckBox.getStyle("fontSize");
trace(oldFontSize);
|
|
|
|