| Flex 2 Developer's Guide >
Building User Interfaces for Flex Applications > Using Flex Visual Components > Using the UIComponent class > Configuring components: syntax summary |
|||
The following table summarizes the MXML and ActionScript component APIs that you use to configure components:
|
|
MXML example |
ActionScript example |
|---|---|---|
|
Read-write property |
<mx:Tile id="tile1"
|
tile1.visible=true;
|
|
Read-only property |
You cannot use a read-only property as an attribute in MXML. |
To get the value of a read-only property: var theClass:String=mp1.className;
|
|
Method |
Methods are not available in MXML. |
myList.sortItemsBy("data", "DESC");
|
|
Event |
<mx:Accordion id="myAcc"
(You must also define a |
private function
...
}
myButton.addEventListener("click", changeHandler);
|
|
Style |
<mx:Tile id="tile1"
|
To set the style: tile1.setStyle("paddingTop", 12);
tile1.setStyle("paddingBottom", 12);
To get the style: var currentPaddingTop:Number = tile1.getStyle("paddingTop");.
|
|
Behavior |
<mx:Tile id="tile1"
|
To set the behavior:
To get the behavior: var currentShowEffect:String = tile1.getStyle("showEffect");
|
Flex 2.01