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..

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top