如何在 Flex 4 中处理位图图像控件上的鼠标单击事件?我看到位图图像控件没有像这样的事件处理程序。
谢谢
This should do the trick (Spark version): (old comment below, applies to previous code posting)
<fx:Script>
import mx.controls.Alert;
protected function graphic_clickHandler(event:MouseEvent):void
{
Alert.show("Image clicked!");
}
</fx:Script>
<s:Graphic id="graphic" click="graphic_clickHandler(event)">
<s:BitmapImage x="0" y="0" source="@Embed(source='testImage.bmp')"/>
</s:Graphic>