Reputation: 7253
I would like to know if the mouse button is down, even if another object is being clicked. How do I do that? Simply adding event listeners doesn't work as it does not trigger if something else is on top of the object.
Thanks
Upvotes: 1
Views: 3061
Reputation: 9572
Add both a Click & MouseDown event listeners to the stage.
If an object is clicked , the event will bubble up to the stage so you should be able to register it and react accordingly.
You can also check the event.currentTarget property to find out where the event originated from , this should tell you if it was the stage or an object being clicked as well as where the mouse down event came from.
Upvotes: 2
Reputation: 11590
Add a mouse down event listener to the stage (or other parent of all objects in question)
Upvotes: 0