Hit events propagate until they are handled. You can stop propagation to the next object (all listeners of the current object still get the event) by telling the system that the event was handled. This boils down to making a listener return true. If at least one of the listeners of the current object returns true, event propagation ends; the next object will not get the event. If the event is still unhandled at the end of this traversal, it is broadcast as a global event to the global Runtime object.
What does it mean when it says that the listener needs to return true.
I have display objects in the hierarchy that have names ( i.e “ground” and “unit” )
I want this function to only account for unit if the unit is above the ground in the display
function action ( e )
if ( e.target.name == “ground” ) then
elseif ( e.target.name == “unit” ) then
end
end
[import]uid: 59590 topic_id: 18790 reply_id: 318790[/import]