I have a Flash project that must display a large amount of irregularly shaped bitmaps (around 10000) and I want to know what bitmap the mouse is currently over. If the mouse is over a transparent part of the bitmap, it shouldn’t count as mouse over.
One way to do this is to calculate the hit area, then replace each bitmap with a Sprite containing the bitmap and another Sprite with the calculated hit area, then set the hitArea property. But this is highly inefficient and the result is completely unusable.
What’s the most efficient way to do this?
Try this on the container:
If the Bitmaps overlap, iterate over
hits. You can also set a threshold for the transparency.