User Guide

67
CHAPTER 5
Customizing Components
You might want to change the appearance of components as you use them in different
applications. There are three ways to accomplish this in Macromedia Flash MX 2004 and
Macromedia Flash MX Professional 2004:
Use the setStyle() method of each component and style declaration to change the color and
text formatting of a component. See “Using styles to customize component color and text”
on page 67.
Apply a theme—a collection of styles and skins that make up a component’s appearance. See
About themes” on page 77.
Modify or replace a component’s skins. Skins are symbols used to display components.
Skinning is the process of changing the appearance of a component by modifying or replacing
its source graphics. A skin can be a small piece, like a border’s edge or corner, or a composite
piece like the entire picture of a button in its up state (the state in which it hasnt been pressed).
A skin can also be a symbol without a graphic, which contains code that draws a piece of the
component. See About skinning components” on page 80.
Using styles to customize component color and text
Every component instance has style properties (also called styles) and setStyle() and
getStyle() methods that you can use to set and get style property values. The setStyle() and
getStyle() methods are inherited from the UIObject class. (For more information, see
UIObject.setStyle() on page 825 and UIObject.getStyle() on page 814.)
Note: You cannot set styles for the Media components.
The styles used by each component depend partially on what theme the document uses (see
About themes” on page 77). Some styles, such as
defaultIcon, are used by the associated
components regardless of the theme applied to the document. Other styles, such as
themeColor
and
symbolBackgroundColor, are used only by components if the corresponding theme is in use.
For example,
themeColor is used only if the Halo theme is in use, and symbolBackgroundColor
is used only if the Sample theme is in use.