Changing skin properties in a subcomponent
There is lot of ways to change the skin properties. But if You use the Following method this will improve your object oriented knowledge.
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 doesn't 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, 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 doesn't 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 should be automatically selected; if it is not, select it.
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.
13. Enter the following code: import mx.controls.ComboBox
Code:
import mx.controls.scrollClasses.ScrollBar
class MyComboBox extends ComboBox{
function getDropdown():Object{
var oldName = ScrollBar.prototype.downArrowDownName;
ScrollBar.prototype.downArrowDownName = "MyScrollDownArrowDown";
var r = super.getDropdown();
ScrollBar.prototype.downArrowDownName = oldName;
return r;
}
}
14. Select File > Save and save this file as MyComboBox.as.
15. Return to the file MyComboTest.fla.
16. Click a blank area on the Stage and, in the Property inspector, click the Publish Settings button.
17. Click the ActionScript Version Settings button.
18. Click the Add New Path (+) button to add a new classpath, and select the Target button to browse to the location of the MyComboBox.as file on your hard disk.
19. Select Control > Test Movie.