The three phases of touch are; began, moved and ended (or cancelled).
When a return true is place in the “moved phase”, it seems the ‘ended’ phase is still invoked.
Am I correct?
The three phases of touch are; began, moved and ended (or cancelled).
When a return true is place in the “moved phase”, it seems the ‘ended’ phase is still invoked.
Am I correct?
you should always get a single ‘ended’ phase, but not until you have lifted your finger and “completed” the touch. before that you might one or many ‘moved’ phases (or none), depending on what you do with the touch.
also you need to return true on ALL of the phases, ‘began’, ‘moved’, and ‘ended’ (and no matter how many ‘moved’ you get). if you don’t, the system will attempt to give the touch event to other objects to handle.
is this what you are expecting ?
All phases are passed to all display objects in the stack until one of them returns true. Calling display.getCurrentStage():setFocus() will tell the system to pass all touch events to that object, even when the touch is not over the target object. This works the same in multitouch, but with touch IDs.
I wasn’t certain what to expect for the propagation. I originally interpreted the ‘return true’ to cancel any further action, including any remaining phases during touch. That is, a ‘return true’ at the ‘moved’ phase would cancel the 'ended phase upon lifting the finger.
Will setFocus pass all touch events to ONLY that object?
Thanks all.
yes, setFocus will have the system to pass all events from the SAME touch (ie, same touch ID) to that object used in setFocus().
i think in most of the examples available you see this where the touch is “bound” to the object in ‘began’ using setFocus, and then in ‘ended’ the touch is “unbound” using setFocus() again. i would think more often than not that this is usually what you want to do.
you should always get a single ‘ended’ phase, but not until you have lifted your finger and “completed” the touch. before that you might one or many ‘moved’ phases (or none), depending on what you do with the touch.
also you need to return true on ALL of the phases, ‘began’, ‘moved’, and ‘ended’ (and no matter how many ‘moved’ you get). if you don’t, the system will attempt to give the touch event to other objects to handle.
is this what you are expecting ?
All phases are passed to all display objects in the stack until one of them returns true. Calling display.getCurrentStage():setFocus() will tell the system to pass all touch events to that object, even when the touch is not over the target object. This works the same in multitouch, but with touch IDs.
I wasn’t certain what to expect for the propagation. I originally interpreted the ‘return true’ to cancel any further action, including any remaining phases during touch. That is, a ‘return true’ at the ‘moved’ phase would cancel the 'ended phase upon lifting the finger.
Will setFocus pass all touch events to ONLY that object?
Thanks all.
yes, setFocus will have the system to pass all events from the SAME touch (ie, same touch ID) to that object used in setFocus().
i think in most of the examples available you see this where the touch is “bound” to the object in ‘began’ using setFocus, and then in ‘ended’ the touch is “unbound” using setFocus() again. i would think more often than not that this is usually what you want to do.