User Guide

112 Customizing Components
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.
To modify default style values in a theme:
1. Create a new folder for your theme in First Run/Classes/mx/skins.
For example, create a folder called myTheme.
2. Copy an existing Defaults class to your new theme folder.
For example, copy mx/skins/halo/Defaults.as to mx/skins/myTheme/Defaults.as.
3. Open the new Defaults class in an ActionScript editor.
Flash Professional 8 users can open the file within Flash. Or, you can open the file in
Notepad in Windows or SimpleText on the Macintosh.
4. Modify the class declaration to reflect the new package.
For example, our new class declaration is
class mx.skins.myTheme.Defaults.
5. Modify the style settings as desired.
For example, change the default disabled color to a dark red.
o.disabledColor = 0x663333;
6.
Save the changed Defaults class file.
7. Copy an existing FocusRect class from the source theme to your custom theme.
For example, copy mx/skins/halo/FocusRect.as to mx/skins/myTheme/FocusRect.as.
8. Open the new FocusRect class in an ActionScript editor.
9. Modify all references to the source theme’s package to the new theme’s package.
For example, change all occurrences of “halo” to “myTheme.
10. Save the changed FocusRect class file.
11. Open the FLA file for your custom theme.
This example uses MyTheme.fla.
12. Open the library (Window > Library) and locate the Defaults symbol.
In this example, it’s in Flash UI Components 2/Themes/MMDefault/Defaults.
13. Edit the symbol properties for the Default symbol.
14. Change the AS 2.0 Class setting to reflect your new package.
The example class is mx.skins.myTheme.Defaults.
15. Click OK.