component就是一个AS class 或者是MXML component文件在manifest文件中映射的标签.分可视和不可视
可视化component包括Containers 和 UI controls
Containers(Appliction, Panel...)
UI controls(Button, Label)
可以通过3种方式设置component的属性
1.tag attributers
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
- </mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
</mx:Application>
中的layout="absolute"
2.nested tags
- <mx:Button id="exampleButton">
- <mx:label>Example Button</mx:label>
- </mx:Button>
<mx:Button id="exampleButton">
<mx:label>Example Button</mx:label>
</mx:Button>
更典型的应用
- <mx:ComboBox id="exampleComboBox">
- <mx:dataProvider>
- <mx:ArrayCollection>
- <mx:String>A</mx:String>
- <mx:String>B</mx:String>
- <mx:String>C</mx:String>
- <mx:String>D</mx:String>
- </mx:ArrayCollection>
- </mx:dataProvider>
- </mx:ComboBox>
<mx:ComboBox id="exampleComboBox">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:String>A</mx:String>
<mx:String>B</mx:String>
<mx:String>C</mx:String>
<mx:String>D</mx:String>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
3.AS ;)
几乎所有的component(所有的可视化component)都有id属性...(吗东东没有呢?),id 由数字,字母,下划线组成.可以由字母下划线开头,但不允许数字开头.
属性值都要用引号括住;)
不可视component
1.Data component(arrays and collections)
2.utility component(data binding component, repeater component)