![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
You can write ActionScript code to set and get style properties on any component instance. The UIObject.setStyle()
and UIObject.getStyle()
methods can be called directly from any component. For example, the following code sets the text color on a Button instance called myButton
:
myButton.setStyle("color", 0xFF00FF");
Even though you can access the styles directly as properties (for example, myButton.color = 0xFF00FF
), it's best to use the setStyle()
and getStyle()
methods so that the styles work correctly. For more information, see Setting style property values.
Note: You should not call the UIObject.setStyle() method multiple times to set more than one property. If you want to change multiple properties, or change properties for multiple component instances, you should create a custom style format. For more information, see Setting styles for specific components.
myComp.setStyle("themeColor", "haloBlue");
The following syntax specifies a property and value for a component instance:
instanceName.setStyle("property", value);
For a list of supported styles, see Supported styles.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |