I have a ui.newButton that calls a function set on the onRelease property.
The function called, creates a new screen which happens to have a button in the same spot. That button however isn’t being built by ui.newButton, but simply and object with a basic event handler:
selectButton:addEventListener("tap", buttonPressed)
What appears to be happening is when I click on the button on the first screen, the second screen is created, but a tap event is sent to the second screen and I’m removing the screen before its displayed. That’s what debugging prints shows. I added a 100ms timer to the buttons on the 2nd screen so they don’t activate immediately and now it works like it should.
I *AM* doing a “return true” in the function called by onRelease so that event shouldn’t continue to propagate. Delaying the buttons becoming active is working, but its a nasty hack I’d like to avoid.
Any thoughts about why my tap event would get passed to the screen I’m creating?
Thanks
Rob
[import]uid: 19626 topic_id: 14027 reply_id: 314027[/import]
[import]uid: 84637 topic_id: 14027 reply_id: 51698[/import]