Question

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

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top