User Guide

About skinning components 105
8. Do one of the following to add a List component to the document:
Drag a List component from the Components panel to the Stage. Enter enough label
parameters so that the vertical scroll bar will appear.
Drag a List component from the Components panel to the library. Enter the following
code on Frame 1 of the main Timeline of SkinsInitExample.fla:
createClassObject(mx.controls.List, "myListBox1", 0, {dataProvider:
["AL","AR","AZ", "CA","HI","ID", "KA","LA","MA"]});
The following example explains how to skin something thats already on the Stage. This
example skins only List scroll bars; any TextArea or ScrollPane scroll bars would not
be skinned.
To use #initclip to apply an edited skin to specific components in a document:
1. Follow the steps in “Editing component skins in a document” on page 97, 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 MyVScrollTest.fla.
4. Drag MyScrollDownArrowDown from the theme library to the MyVScrollTest.fla library.
5. Select Insert > New Symbol and give the symbol a unique name, such as MyVScrollBar.
6. Select the Export for ActionScript check box. Click OK.
Export in First Frame should be automatically selected; if it is not, select it.
7. Enter the following code on Frame 1 of the MyVScrollBar symbol:
#initclip 10
import MyVScrollBar
Object.registerClass("VScrollBar", MyVScrollBar);
#endinitclip
8.
Drag a List component from the Components panel to the Stage.
9. In the Property inspector, enter as many Label parameters as necessary for the vertical scroll
bar to appear.
10. Select File > Save.
11. Select File > New and create a new ActionScript file.
NOTE
Add enough data so that the vertical scroll bar appears, or set vScrollPolicy to
true.