User Guide

About skinning components 89
Changing skin properties in the prototype
If a component does not directly support skin variables, you can subclass the component and
replace its skins. For example, the ComboBox component doesnt directly support skinning its
drop-down list, because the ComboBox component uses a List component as its drop-down list.
If a component is composed of subcomponents, the subcomponents are identified in the
component’s entry in Chapter 6, “Components Dictionary.
To skin a subcomponent:
1.
Follow the steps in “Editing component skins in a document” on page 81, but edit a scroll bar
skin. For this example, edit the ScrollDownArrowDown skin and give it the new name
MyScrollDownArrowDown.
2.
Select File > New and create a Flash document.
3.
Select File > Save and give the file a unique name, such as MyComboTest.fla.
4.
Drag MyScrollDownArrowDown from the theme library above to the Stage of
MyComboTest.fla, and delete it.
This adds the symbol to the library, but doesnt make it visible on the Stage.
5.
Select Insert > New Symbol and give the symbol a unique name, such as MyComboBox.
6.
Select the Export for ActionScript check box and click OK.
Export in First Frame is automatically selected.
7.
Enter the following code in the Actions panel on Frame 1 of the MyComboBox symbol:
#initclip 10
import MyComboBox
Object.registerClass("ComboBox", MyComboBox);
#endinitclip
8.
When you finish editing the symbol, click the Back button at the left side of the information
bar at the top of the Stage to return to document-editing mode.
9.
Drag a ComboBox component to the Stage.
10.
In the Property inspector, enter as many Label parameters as necessary for the vertical scroll bar
to appear.
11.
Select File > Save.
12.
Select File > New and create a new ActionScript file.