数据组中的图库,我如何调用所选图像(鼠标单击图像)这是我的示例代码
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.managers.PopUpManager;
import spark.components.Image;
import spark.components.TitleWindow;
[Bindable]
private var myArray:ArrayCollection= new ArrayCollection([
{image:'Assets/images/best_01.jpg'},
{image:'Assets/images/best_02.jpg'},
{image:'Assets/images/best_03.jpg'},
{image:'Assets/images/best_04.jpg'}]);
private function imageClickHandler(event:MouseEvent):void {
var imgCount:Number=0;
var image:Image= new Image();
PopUpManager.addPopUp(image,this,true);
image.source=myArray.getItemAt(imgCount).image;
}
]]>
</fx:Script>
<s:DataGroup id="dg" itemRenderer="com.ItemRenderForHorizontallist"
dataProvider="{myArray}"
verticalCenter="0"
horizontalCenter="0"
click="imageClickHandler(event)">
<s:layout >
<s:TileLayout horizontalGap="20" verticalGap="20" columnWidth="180" />
</s:layout>
</s:DataGroup>
- 此代码有效,但我想要选定的图像(鼠标单击图像)任何人帮助我............谢谢*