[Resolved] Avoiding button touch through scenes

Hi,

I am using storyboard and by pushing a button and holding it down, I am switching to another scene. The problem is that I am having buttons in the new scene where the user is pushing and that triggers those buttons. I have to have it like this and the user has to hold down the button, and I can’t move my buttons in the second scene.

Any suggestion to avoid the next scene to receive the event? I tried setFocus but I am not understanding it 100%.

Any suggestion to this weird problem?

Kind regards, Joakim [import]uid: 81188 topic_id: 28246 reply_id: 328246[/import]

There are two ideas that pop to mind instantly. I don’t use storyboard so dunno if it works.

First would be depending how much the person has to hold down the button, you could remove all the event listeners and just add them with a timer to come alive a few seconds after it loads the page. This one isn’t really reliable since the player could always just hold down the button forever.

The second one that might work is add an if event.phase == “ended” to the function that changes scenes and add all the listeners there, so once he lets go of the button all the new buttons come alive. This one would work perfectly if it actually works. I’ve never tried adding eventListeners like this, if you end up trying it and it works please let me know. [import]uid: 77199 topic_id: 28246 reply_id: 114146[/import]

Haven’t encountered this specific issue but I’m thinking that one other option *could* potentially be returning true at the end of the function, although “hatethinkingofnames” suggestions are both very solid also, I would think one of these would work. [import]uid: 52491 topic_id: 28246 reply_id: 114205[/import]

@ hatethinkingofnames, I go for the “ended” solution - that would work!

Thanks, Joakim [import]uid: 81188 topic_id: 28246 reply_id: 114222[/import]