Tap/Touch and Layers

Hello all, I am guessing there is an answer to this somewhere as this seems pretty basic but I could not find it. Anyway, my question is this: Suppose I have multiple objects stacked in Z, one on top of the other and each one has a tap event registered. Currently, if I tap the top object, ALL objects under that x,y location will receive the tap event.

How can I either:

Determine who the top most target is (each item may be in different display groups)?
or
Lock the event to the top most object. (i.e. have the top most object "consume" the event)

This occurs, for example, when I bring up a dialog box overlay. Any clicks within the box are also registered in the screen below.

Thanks!

If you put "return true" to the end of listener function, the event propagation stops. it means only the top most object will trigger the event, and the rest will not receive the event.

Culutas, you da man! Thank you so much. That did the trick.

Glad to hear ;)

views:1646 update:2011/9/27 8:54:05
corona forums © 2003-2011