Flex中ComboBox静态数据绑定的3种写法

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12">
<mx:ComboBox id="cmb1" x="10" y="10">
   <mx:Array>
    <mx:Object data="first" label="第一项"/>
    <mx:Object data="second" label="第二项"/>
    <mx:Object data="third" label="第三项"/>
   </mx:Array>
</mx:ComboBox>
<mx:Array id="arr1">
   <mx:Object data="fouth" label="第四项"/>
   <mx:Object data="fifth" label="第五项"/>
   <mx:Object data="sixth" label="第六项"/>
</mx:Array>
<mx:ComboBox id="cmb2" dataProvider="{arr1}" x="10" y="70"/>
<mx:ComboBox id="cmb3" x="10" y="100">
   <mx:dataProvider>
    {arr1}
   </mx:dataProvider>
</mx:ComboBox>
</mx:Application>
posted @ 2009-04-11 15:46  杨子宜  阅读(1072)  评论(0编辑  收藏  举报