Flex4 学习笔记-comboBox 和 List组件的使用
?
Flex4中的List组件的使用,具体代码如下:
<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="application1_creationCompleteHandler(event)" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"><s:layout><s:BasicLayout/></s:layout><fx:Script><![CDATA[import mx.collections.ArrayCollection;import mx.events.FlexEvent;[Bindable]private var listData:ArrayCollection = null;protected function application1_creationCompleteHandler(event:FlexEvent):void{// TODO Auto-generated method stublistData = new ArrayCollection([{label:"请选择"},{label:"语文"},{label:"数学"},{label:"英语"}]);}]]></fx:Script><fx:Declarations><!-- 将非可视元素(例如服务、值对象)放在此处 --></fx:Declarations><!--定义List列表--><s:List id="sid" y="200" x="400" dataProvider="{listData}" selectedIndex="0"/></s:Application>
?