Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 185

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

Advertisement

Setting styles using MXML tag attributes
Component users can use MXML tag attributes to set a style property on a component. For
example, the following code creates a TextArea control, then sets the
of the component to blue (0x0000FF):
<mx:TextArea id="myTA" backgroundColor="0x0000FF"/>
Setting styles using the setStyle() method
Component users can use the
For example, the following code creates a
style of the component to blue (0x0000FF):
var myTA:TextArea=new TextArea()
myTA.setStyle('backgroundColor', 0x0000FF);
Setting styles using CSS
Component users can use the
the following example shows:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="myComponents.*" >
<mx:Style>
TextArea {backgroundColor: "0x0000FF"}
</mx:Style>
<mx:TextArea/>
</mx:Application>
You can also import an external CSS file, as the following example shows:
<mx:Style source="myStyle.css"/>
method to set a style property on a component.
setStyle()
TextArea
tag to set CSS styles in an MXML application, as
<mx:Styles>
backgroundColor
control, then sets the
style
backgroundColor
About styles
185

Advertisement

Table of Contents
loading

Table of Contents