Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Customizing Components > About themes > Modifying default style property values in a theme | |||
The default style property values are provided by each theme in a class named Default. To change the defaults for a custom theme, create a new ActionScript class called Default in a package appropriate for your theme, and change the default settings as desired.
For example, create a folder called myTheme.
For example, copy mx/skins/halo/Defaults.as to mx/skins/myTheme/Defaults.as.
Flash users can open the file within Flash. Or, you can open the file in Notepad in Windows or SimpleText on the Macintosh.
For example, our new class declaration is class mx.skins.myTheme.Defaults.
For example, change the default disabled color to a dark red.
o.disabledColor = 0x663333;
For example, copy mx/skins/halo/FocusRect.as to mx/skins/myTheme/FocusRect.as.
For example, change all occurrences of "halo" to "myTheme."
This example uses MyTheme.fla.
In this example, it's in Flash UI Components 2/Themes/MMDefault/Defaults.
The example class is mx.skins.myTheme.Defaults.
In this example, it's in Flash UI Components 2/Themes/MMDefault/FocusRect.
The example class is mx.skins.myTheme.FocusRect.
Remember to include the Defaults and FocusRect symbols when dragging assets from your custom theme to the target document.
In this example you used a new theme to customize the text color of disabled components. This particular customization, changing a single default style property value, would have been accomplished more easily through styling as explained in Using styles to customize component color and text. Using a new theme to customize defaults is appropriate when customizing many style properties or when already creating a new theme to customize component graphics.
Flash CS3