I think I may have found a bug in Actionscript 3.0.
If a display object is a child of another display object,
such as a Sprite object inside another Sprite object, then
MouseEvents such as MouseEvent.CLICK, and MouseEvent.MOUSE_DOWN
that are attached to the inner display object do not register every
time they should be dispatched. A 'dead click' occurs every other
For example, in my current game I have a sprite container
called gameElements where all interactive game elements are added.
The GameElements container is added to the display list of the
root. Any game element I add to the gameElements display list would
not perform they're MouseEvent Listener function when I click on
them. However, if I simply add the game element to the root display
list, MouseEvents like MouseEvent.CLICK and MouseEvent.MOUSE_DOWN
fire correctly every time they're dispatched.
Does this make sense? Has anyone had any experience with
this? Does anyone know how to fix this? I would prefer to use my
Game.gameElements display list structure.
I have a large text area in front of the game element that
'swallows' the mouseEvent and keeps it from dispatching every time
the game element is clicked. The text area acts as an output window
that I can utilize while I'm testing in a browser. Once I made sure
that the text area was at a depth lower than the game elements,
everything worked fine.