In my app I have a few buttons in the corners, and a large “background” space that takes up the rest of the screen. I want to write a handler that responds to a tap ONLY IF IT IS NOT IN ANY WIDGET.
There are two types of events that get generated with taps: a tap event if the touch starts and ends in a certain time window and there isn’t much in the way of moment and a set of touch events (the began phase, ended phase and possible moved phases).
Depending on the widget (I’m going to assume widget.newButton), it’s only handling a touch event and letting the tap event go through.
I would suggest having your background handle touch events and not taps.
I never use currentStage. It’s the highest order display object and it may be acting like the front most element, not the back most. Do you have a background object (image, rectangle) that you could but it on instead of currentStage?
Returning from holiday and other distractions, I have tried your suggestion. It STILL lets events through to the background object behind the buttons. My background object is colored, so it plainly shows that it is correctly positioned behind the buttons. Still, it gets every tap, on a button or elsewhere. Here’s the setup:
There are two types of events that get generated with taps: a tap event if the touch starts and ends in a certain time window and there isn’t much in the way of moment and a set of touch events (the began phase, ended phase and possible moved phases).
Depending on the widget (I’m going to assume widget.newButton), it’s only handling a touch event and letting the tap event go through.
I would suggest having your background handle touch events and not taps.
I never use currentStage. It’s the highest order display object and it may be acting like the front most element, not the back most. Do you have a background object (image, rectangle) that you could but it on instead of currentStage?
Returning from holiday and other distractions, I have tried your suggestion. It STILL lets events through to the background object behind the buttons. My background object is colored, so it plainly shows that it is correctly positioned behind the buttons. Still, it gets every tap, on a button or elsewhere. Here’s the setup: