# How to detect click or touch on an irregular image

**URL:** https://forum.kirupa.com/t/how-to-detect-click-or-touch-on-an-irregular-image/329802
**Category:** programming
**Created:** [October 18, 2012, 7:44am UTC](https://forum.kirupa.com/t/how-to-detect-click-or-touch-on-an-irregular-image/329802 "2012-10-18T07:44:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kadaj](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kadaj/32/9061_2.png) [@kadaj](https://forum.kirupa.com/u/kadaj)
#### Post date: [October 18, 2012, 7:44am UTC](https://forum.kirupa.com/t/how-to-detect-click-or-touch-on-an-irregular-image/329802/1 "2012-10-18T07:44:59Z")

</div>

How to detect click or touch on an irregular image, say an image of an animal where animals overlap slightly. The image is a bitmap image say png, or jpg. So if I convert it into movie clip or button, it will be a rectangular area instead of that animal’s boundary. I can add layer masks over the image, but then that is particular to that image. For another image, I will have to manually add masks.

I have seen senocular’s post [actionscript.org](http://www.actionscript.org/forums/showpost.php3?p=830945&postcount=5). That will work if it is an animal, but in case of our target image where we have alpha transparency within it, then how to do?

I think the click event will scale to mobile apps as well.
