User Guide
Using styles to customize component color and text 87
To change one or more properties in the global style declaration:
1. Make sure the document contains at least one component instance.
For more information, see “Adding components to Flash documents” on page 50.
2. Select a frame in the Timeline on which (or before which) the components appear.
3. In the Actions panel, use code like the following to change properties on the global style
declaration. You need to list only the properties whose values you want to change, as
shown here:
_global.style.setStyle("color", 0xCC6699);
_global.style.setStyle("themeColor", "haloBlue")
_global.style.setStyle("fontSize",16);
_global.style.setStyle("fontFamily" , "_serif");
4.
Select Control > Test Movie to see the changes.
Setting custom styles for groups of components
You can create custom style declarations to specify a unique set of properties for groups of
components in your Flash document. In addition to the _global object’s
style property
(discussed in “Setting global styles” on page 86), which determines the default style
declaration for an entire Flash document, the _global object also has a
styles property,
which is a list of available custom style declarations. So, you can create a style declaration as a
new instance of the CSSStyleDeclaration object, assign it a custom style name, and place it in
the
_global.styles list. Then, you specify the properties and values for the style, and assign
the style name to component instances that should share the same look.
Keep in mind that when you assign the style name to a component instance, the component
responds only to style properties that component supports. For a list of the style properties
each component supports, see the individual component entries in the Components Language
Reference.
To make changes to a custom style format, use the following syntax:
_global.styles.CustomStyleName.setStyle(propertyName, propertyValue);
Custom style settings have priority over class, inherited, and global style settings. For a list of
style precedence, see “Using global, custom, and class styles in the same document”
on page 92.