0

如何在 Flex 4 中处理位图图像控件上的鼠标单击事件?我看到位图图像控件没有像这样的事件处理程序。

谢谢

4

1 回答 1

2

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>
于 2012-07-01T16:36:42.463 回答