User Guide

Using styles to customize component color and text 83
Understanding style settings
As you use styles and style declarations, you’ll notice that you can set styles in various ways (at
the global, theme, class, style declaration, or style property levels). And, some style properties
may be inherited from a parent component (for example, an Accordion child panel may
inherit a font treatment from the Accordion component). Here are a few key points about
style behavior:
Theme dependence The style properties you can set on a particular component are
determined by the current theme. By default, Flash components are designed to use the Halo
theme, but Flash also provides a Sample theme. So, when you read a style properties table, like
the one for the Button component in “Using styles with the Button component” in the
Components Language Reference, notice which theme supports the style you want. The table
indicates Halo, Sample, or Both (meaning both themes support the style property). To change
the current theme, see “Switching themes” on page 108.
Inheritance You cannot set inheritance within ActionScript. A component child is designed
either to inherit a style from the parent component, or not.
Global style sheets Style declarations in Flash dont support “cascading” for Flash
documents the way CSS does for HTML documents. All style sheet declaration objects are
defined at the application (global) level.
Precedence If a component style is set in more than one way (for example, if textColor is
set at the global level and at the component instance level), Flash uses the first style it
encounters according to the order listed in “Using global, custom, and class styles in the
same document” on page 92.
Setting styles
The existence of style properties, their organization within style declarations, and the broader
organization of style declarations and graphics into themes enables you to customize a
component in the following ways:
Set styles on a component instance.
You can change color and text properties of a single component instance. This is effective
in some situations, but it can be time consuming if you need to set individual properties
on all the components in a document.
For more information, see “Setting styles on a component instance” on page 84.
Adjust the global style declaration that sets styles for all components in a document.
If you want to apply a consistent look to an entire document, you can create styles on the
global style declaration.
For more information, see “Setting global styles” on page 86.