F > FStyleFormat (object) |
![]() ![]() ![]() |
FStyleFormat (object)
The FStyleFormat object lets you set or change properties in the global style format assigned to all Flash UI components by default, or create new custom style formats to use with Flash UI components or custom components that you create or acquire from other sources. The global style format, or globalStyleFormat
object, is an instance of the FStyleFormat object that defines the color and text formatting properties used to display all Flash UI components.
To create a new custom style format, you create a new instance of the FStyleFormat object using the new FStyleFormat()
constructor, set the FStyleFormat properties that you want to include in your style format, and then use the FStyleFormat.addListener
method to register component instances to the new style format. A component instance can "listen" to more than one style format, but can only take the value of one style format for a specific property. If you add a component as a listener to a style format, it uses the new style format for properties specified in the format, and it uses the old style format for all other properties.
You do not need to use the FStyleFormat constructor to add or remove listeners or set or change properties in the global style format because the globalStyleFormat
object exists once any Flash UI component is placed on the Stage.
You can set any of the FStyleFormat properties for a single instance of a component using the setStyleProperty
method available to all Flash UI components. Using setStyleProperty
allows you to set a property for a component without creating an instance of the FStyleFormat object. Using setStyleProperty
overrides the setting for a specific style format property assigned to the component without changing the other property settings. For more information, see the setStyleProperty
entries for individual components.
When assigning a color value to an FStyleFormat property, specify an RGB color in the format 0xRRGGBB
.
For more information on the global style format and creating custom style formats, see Customizing component colors and text in the Using Components chapter of Using Flash.
Method Description Registers a component to a style format. Applies the changes made to property values in a style format. Removes a component as a listener to a style format.
Method summary for the FStyleFormat object
FStyleFormat.addListener
FStyleFormat.applyChanges
FStyleFormat.removeListener
![]() ![]() ![]() |