理解 flex component

component就是一个AS class 或者是MXML component文件在manifest文件中映射的标签.分可视和不可视
可视化component包括Containers 和 UI controls
Containers(Appliction, Panel...)
UI controls(Button, Label)
可以通过3种方式设置component的属性
1.tag attributers

Java代码 复制代码
  1. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">   
  2. </mx:Application>  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
</mx:Application>

中的layout="absolute"
2.nested tags

Java代码 复制代码
  1. <mx:Button id="exampleButton">   
  2.   <mx:label>Example Button</mx:label>   
  3. </mx:Button>  
<mx:Button id="exampleButton">
  <mx:label>Example Button</mx:label>
</mx:Button>


更典型的应用

Java代码 复制代码
  1. <mx:ComboBox id="exampleComboBox">   
  2.   <mx:dataProvider>   
  3.     <mx:ArrayCollection>   
  4.       <mx:String>A</mx:String>   
  5.       <mx:String>B</mx:String>   
  6.       <mx:String>C</mx:String>   
  7.       <mx:String>D</mx:String>   
  8.     </mx:ArrayCollection>   
  9.   </mx:dataProvider>   
  10. </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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值