Using Components > Customizing component colors and text > Changing the properties of specific components |
![]() ![]() ![]() |
Changing the properties of specific components
You can create custom style formats to specify a unique set of properties for specific components in your Flash document. You use the FStyleFormat object constructor to create a new instance of the FStyleFormat object, to define your custom style format, and to specify the properties and values for the format. The FStyleFormat object is accessible if you have placed at least one component instance on the Stage. It is recommended that you use a separate layer in the document Timeline to set properties.
You make changes to a custom style format in the same way that you edit the properties in the global style format. Instead of the globalStyleFormat
object name, use the FStyleFormat
object name. See Changing properties of all Flash UI components.
The FStyleFormat object has three methods in addition to the constructor method:
![]() |
|
![]() |
|
![]() |
|
For more information, see FStyleFormat (object) in the ActionScript Dictionary.
The following table summarizes the properties of the FStyleFormat object. For a complete description of each property, see the individual entries in the online ActionScript Dictionary. You can set or change any of the FStyleFormat object properties in the global style format, or in custom style formats that you create.
Property summary for the FStyleFormat object
Property |
Description |
---|---|
The color of the arrow used in scroll bars and drop-down lists. |
|
The color of the background portion of components. |
|
The color of the background portion of disabled components. |
|
The color of the check in a selected check box. |
|
The color of the inner border or shadow portion of a component. |
|
The main color of the component. |
|
The foreground color of a disabled component. |
|
The color of the inner border or darker shadow portion of a component when it is selected. |
|
The color for the outer border or light shadow portion of a component when it is selected. |
|
The color of the dot in a selected radio button. |
|
The color of the track in a scroll bar. |
|
The color of the selection bar highlighting an item in a list of a component. |
|
The color of the selection bar that highlights an item in a list of a disabled component. |
|
The color of the selection bar (highlighting) when the component does not have keyboard focus. |
|
The color of the outer border or light shadow portion of a component. |
|
Specifies left, right, or center alignment for text displayed in or on a component. |
|
Specifies whether text is bold ( |
|
The color of list items in a component when they are not selected. |
|
The color of the text in a disabled component. |
|
The name of the font to display text. |
|
The indentation of the text from the left margin to the first text character in pixels. |
|
Specifies whether text is italic (true) or not (false). |
|
The left paragraph margin in text in pixels. |
|
The right paragraph margin for text in pixels. |
|
The color of a selected list item in a component. |
|
The size of the text in points. |
|
Specifies whether text is underlined (true) or not (false). |
1 |
Make sure the document contains at least one component instance. See Adding components to Flash documents. |
2 |
Create a new layer in the Timeline and give it a name. |
3 |
Select any frame in the new layer. |
4 |
Open the Actions panel in expert mode. |
5 |
Use the following syntax to create an instance of the FStyleFormat object to define the new custom style format: |
var myStyleFormat = new FStyleFormat(); |
|
6 |
In the same Script pane as above, use the following syntax to specify the properties you want to define for the |
myStyleFormat.arrow = 0x333300; myStyleFormat.background = 0xffffff; myStyleFormat.backgroundDisabled = 0xccffcc; myStyleFormat.darkshadow = 0x333300; myStyleFormat.foregroundDisabled = 0x999999; myStyleFormat.face = 0x99cc99; myStyleFormat.textSize = 12 myStyleFormat.highlight = 0x99cc00; myStyleFormat.highlight3D = 0x333300; myStyleFormat.radioDot = 0x333300; myStyleFormat.scrollTrack = 0x99cc99; myStyleFormat.selection = 0x333300; myStyleFormat.selectionDisabled = 0x999999; myStyleFormat.selectionUnfocused = 0x999999; myStyleFormat.shadow = 0x99cc00; myStyleFormat.textColor = 0x000000; myStyleFormat.textDisabled = 0x999999; myStyleFormat.textSelected = 0x000000; |
|
7 |
In the same Script pane, use the following syntax to assign the format style to specific components. |
myStyleFormat.addListener(myComboBox, myListBox); |
|
8 |
Use the following syntax to remove a component from a style format: |
myStyleFormat.removeListener(myComboBox); |
![]() ![]() ![]() |