User Guide

106 Customizing Components
12. Enter the following code:
import mx.controls.VScrollBar
import mx.controls.List
class MyVScrollBar extends VScrollBar{
function init():Void{
if (_parent instanceof List){
downArrowDownName = "MyScrollDownArrowDown";
}
super.init();
}
}
13.
Select File > Save and save this file as MyVScrollBar.as.
14. Click a blank area on the Stage and, in the Property inspector, click the Publish
Settings button.
15. Click the ActionScript Version Settings button.
16. Click the Add New Path (+) button to add a new classpath, and select the Target button
to browse to the location of the MyVScrollBar.as file on your hard disk.
17. Select Control > Test Movie.
Changing skin properties in a subcomponent
If a component does not directly support skin variables, you can create a subclass of 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 the Components Language Reference.
To skin a subcomponent:
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 MyComboTest.fla.
4. Drag MyScrollDownArrowDown from the theme library above to the library of
MyComboTest.fla.
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.