Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 89

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

Applying a type selector to the root tag of a custom
component
All custom components contain a root tag that specifies the superclass of the component. In
the case of StateComboBox.mxml, the root tag is
selector for the
ComboBox
main application file, that style definition is also applied to any custom component that uses a
ComboBox control as its root tag, as the following example shows:
<?xml version="1.0"?>
<!-- mxml/MainStyleOverrideUsingCBTypeSel.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="myComponents.*">
<mx:Style>
ComboBox {
openDuration: 1000;
fontSize: 15;
color: red;
}
</mx:Style>
<MyComp:StateComboBoxWithStyleProps/>
<mx:ComboBox/>
</mx:Application>
In this example, all ComboBox controls and all StateComboBox.mxml controls have an
of 1000 ms,
openDuration
control, or for a superclass of the ComboBox control, in your
of 15 points, and red text.
fontSize
. If you define a type
<mx:ComboBox>
Applying styles to your custom component
89

Advertisement

Table of Contents
loading

Table of Contents