Here is a quick tip for Flash/Flex or Flash Builder or anything that uses ActionScript 3. If you are having a (fast) moving animated DisplayObjects that you want the user to be able to click, I suggest NOT using the MouseEvent.CLICK but MouseEvent.MOUSE_DOWN. MouseEvent.MOUSE_DOWN works a lot better and it fires faster than the MouseEvent.CLICK event.
Today I was coding a game, that some monsters were running and the user had to click on them to "kill" them. Without even thinking I used the MouseEvent.CLICK event, but when I tried to kill those bastards, I had to click again and again to hit them. My first reaction is to panic, but then I change CLICK to MOUSE_DOWN and voila!
So the lesson for today...
MouseEvent.MOUSE_DOWN Event, instead of MouseEvent.CLICK!
Comments
Post new comment