OnClick - Is there anything similar to e.preventDefault() ?

I'm trying to fire a click event on a menu button and also there is a snippet I run if I click on the Background Area.

My problem is if I click on the menu button, the Background scene object click-event runs instead of MenuBtn sceneObject click event. So I was wondering if there is anything similar to e.preventDefault() that will run my MenuBtn click event instead of BG click-event.

I tried placing them in different layers and using e.topLayer property to call events but that didn't work as well.

Gio, can you please help?

All 3 Comments

Hello! Here the snipet!


Just add some

obj.onClick = function() {
            return true;

to stop bubbling event


Hey Krumza, can you please tell me where should I return true...? On the BG Scene Object listener or my Menu Scene Object listener? Menu is on the BG by the way. And I want Menu to be triggered.


Hey nevermind... Checked out the snippet and got an idea... Will try that... Thanks for pointing in the right direction :) 

Post a reply
Add Attachment
Submit Reply
Login to Reply