我有一个充满dataProvider (ArrayCollection)的HorizontalList,如下所示:
[Bindable]
[Embed(source="assets/empty.jpg")]
public var empty:Class;
private function init(nbr){
var myArray : ArrayCollection = new ArrayCollection;
for( var i=0 ; i<nbr ; i++){
myArray.addItem({label:"Page" + i , icon:"empty"});
}
myHorizontalList.dataProvider = myArray;
}出于某些原因,我必须执行以下操作,当单击一个项目时,该项目的图标图像必须更改为其他图像。
有人能帮帮我吗?我是flex新手,谢谢
发布于 2012-05-22 02:05:16
您应该在列表中使用change事件。它应该调用一个方法来更改选定的图像。如下所示:
<mx:List id="imageList" dataProvider="{dataList}" change="{onChange(event)}" />
public function onChange(event:Event):void
{
image.source = imageList.selectedItem.url;
}如果你需要任何进一步的解释,请告诉我。
https://stackoverflow.com/questions/10687498
复制相似问题