how to optimize the `button hit testing` cost in flash

587 Views Asked by At

My program is a mmorpg game using flash. Now I found button hit testing cost a lot of time. I think there is no DisplayObject to remove to speed up. I don't know how to optimize it..

1

There are 1 best solutions below

1
On BEST ANSWER

It seems a backward-compatible technique that can't be simply shut off.

Apparently, button hit testing is completely bypassed when using touch events instead of mouse events. Of course, this is not applicable if you want to target in-browser PC users..

If you're building the game for mobile devices, use touch events, like this:

Multitouch.mapTouchToMouse = false;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; 
addEventListener(TouchEvent.TOUCH_BEGIN, onActualStageTouch);

A useful discussion on the Adobe forum is here: http://forums.adobe.com/message/5346701#5346701