简体   繁体   中英

Flex Spark PNG Image with Transparency acting as button

I have a PNG image that has some transparency it is a 20px x 20px png image of an X. Given the shape of the X the hit state is odd since it gets interpreted as transparent. How do you make the whole area 20px x 20px clickable?

<s:Image id="closeOut" y="10" source="@Embed('/assets/png/X.png')" click="this.visible=false"/>

If you hover over where ever there isn't the X, left and right mostly it isn't clickable. Thoughts?

Add the image in a group of 20x20px and add the mouse event on the group and not on the image.

<s:Group y="10" width="20" height="20" click="this.visible=false">
      //Your image here
</s:Group>

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM