touch phase issue

Is there a phase for when a user drags their finger off an object with a touch listener?

For example, I have a shoot button. It works fine if the user pushes the button and if they pull their finger off it stops activating; however if you drag your thumb off of the button it stays activated. I know about the “moved” phase. Without a moved phase the buttons are really finnicky if you want to hold them down as the user really needs to hold their finger still on the button, so I would rather not take the moved phase out. Is there some phase that says if the touch is not within the geometry of the touched shape then stop activating? [import]uid: 10903 topic_id: 8089 reply_id: 308089[/import]

Unfortunately, no.

I’ve had a similar problem where I’m listening for touch event on an object and they start being fired even if they touch does not start on the object. That’s a problem because the ‘began’ phase will not be called on the object. Sort of the flip side of your problem.

I believe the solution is to have a background object which can take the setFocus if nothing it touched.

The solution to your problem is probably to listen for touch events outside of the object and not to use setFocus, as that will always send them to your object’s listener. This will be tricky, of course.

I’ve not checked, but doesn’t the UI library do something like this (albeit with just rectangular objects?) [import]uid: 8271 topic_id: 8089 reply_id: 28923[/import]

Maybe this should just be put in as a feature request. [import]uid: 10903 topic_id: 8089 reply_id: 28993[/import]