Reputation: 185
How can I handle mouse click event on Bitmap image control in Flex 4? I saw there is no event handler like this for Bitmap image control.
Thanks
Upvotes: 0
Views: 1573
Reputation: 159844
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>
Upvotes: 2