[英]How to find mouse click event on Flex 4 Bitmap Image control
How can I handle mouse click event on Bitmap image control in Flex 4? 如何在Flex 4中的位图图像控件上处理鼠标单击事件? I saw there is no event handler like this for Bitmap image control.
我看到没有像这样的事件处理程序用于位图图像控制。
Thanks 谢谢
This should do the trick (Spark version): (old comment below, applies to previous code posting) 这应该做的伎俩(Spark版本):(下面的旧评论,适用于以前的代码发布)
<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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.