Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Customizing Components > About skinning components > 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 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 ActionScript 2.0 Components Language Reference.
This adds the symbol to the library, but doesn't make it visible on the Stage.
Export in First Frame should be automatically selected; if it is not, select it.
MyComboBox symbol:
#initclip 10
import MyComboBox
Object.registerClass("ComboBox", MyComboBox);
#endinitclip
import mx.controls.ComboBox
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;
}
}
Flash CS3