HorizontalList 动态添加数据,请帮忙!
<mx:HorizontalList > <mx:dataProvider> <mx:Array> <mx:Object label="Backpack" icon="@Embed('images/backpack.jpg')"/> <mx:Object label="Compass" icon="@Embed('images/compass.jpg')"/> </mx:Array> </mx:dataProvider></mx:HorizontalList>
<mx:HorizontalList dataProvider="{arrobj}" > <mx:dataProvider> <mx:Array> <mx:Object label="Backpack" icon="@Embed('images/backpack.jpg')"/> <mx:Object label="Compass" icon="@Embed('images/compass.jpg')"/> </mx:Array> </mx:dataProvider></mx:HorizontalList><mx:Script> [Bindable] private var arrobj:Array = new Array(); public function addListObj():void{ var obj:Object=new Object(); obj.label="ffff"; arrobj.push(obj); }</mx:Script>
[Bindable]private var listArr:ArrayCollection=new ArrayCollection();private function init():void{ var obj:Object=new Object(); obj.label="aaa"; listArr.addItem(obj);}