eventListeners on/off ?

Hello! My problem is that I have an area that has a tap-listener and on that i have buttons and other things that one can press. but when one presses the buttons, the area beneath also responds to it’s listener.

Is there some kind of layer-thing for listeners so that when I press the buttons, only the buttons respond?

Hi @tistou.blomberg,

Yes, the simple solution is to add “return true” at the end of your listener function(s) for the button(s). This will prevent the tap/touch from propagating through to things below.

See this guide for more information:

http://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Take care,

Brent

Hi @tistou.blomberg,

Yes, the simple solution is to add “return true” at the end of your listener function(s) for the button(s). This will prevent the tap/touch from propagating through to things below.

See this guide for more information:

http://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Take care,

Brent