This content has been marked as final. Show 3 replies
I read that you can't listen for events fired on another object. You could listen in the object's container though, as events cascade and bubble.
Hi, thanks for reply. Could you please explain it litle bit more :) Maybe some example... Problem is that if one object is laying on second object and I move with mouse on the second object with no event listener, no event is dispatched at all, even I have physically mouse cursor on both of object.....
If both objects are in a VBox, with the second object (no listener) overlapping the first object (has listener), when you hover over second object, if you have a listener on the container you should be able to see if the target for the event is the second object and then take action.
This is because events first "cascade" down from the top of the display list, through all containers until they reach the target (targetting phase), and then they bubble back up to the top of the display list (bubling phase).