flex
flex

Reputation: 185

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? I saw there is no event handler like this for Bitmap image control.

Thanks

Upvotes: 0

Views: 1573

Answers (1)

Reimeus
Reimeus

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

Related Questions