|
You must add the mouse listeners to the buttons instead of the stage, like:
tile1.addEventListener(MouseEvent.CLICK, placeX);
tile2.addEventListener(MouseEvent.CLICK, placeX);
...
and
tile1.addEventListener(MouseEvent.DOUBLE_CLICK, placeO);
tile2.addEventListener(MouseEvent.DOUBLE_CLICK, placeO);
...
There is a chance you must swap e.target with e.currentTarget in the handlers as well. I don't have the documentation handy right now.
Another solution is to add MouseChildren = false to the buttons, like: tile1.MouseChildren = false; so only the button itself will trigger the event and not any other children objects (like the text) inside them.
Last edited by djpaul1963; 02-08-2013 at 04:19 PM..
|