If I have a clip with an imported image then clip.onPress
reacts on the
bounding box of the clip rather then on the exact shape of
image even if the imported image has a transparent
To make it to react to in image shape only I have to use
Trace BitMap which
results in deterioration of the image quality and if the clip
Trace BitMap also slows down computer perfprmance.
Is there other technique to make onPress to react on the
exact shape, rather
then on the bounding box?
An image is always rectangular, it just may have transparent
parts. So an MC containing an image is always as big as the whole
image (at least).
You could use the MovieClip.hitArea property, and create
another MC inside your clip that specifies the active area for
mouse clicks. This is easy if you have the image loaded into the
clip inside the Flash IDE.
If it's loaded on runtime, you might use the BitmapData class
(if you use Flash 8) to get the pixel value of the image at the
position where the image was clicked, check if it's transparent or
opaque, and decide whether to call the onPress action or not.