OK, an update on this.

I think the problem is that while dragging quickly the clip or sprite being moved falls behind the motion of the finger so that the TOUCH_END event occurs when the finger is no longer over the sprite/MC and so any handler attached to the sprite is not activated - hence the incomplete sequence. Attaching the TOUCH_END handler to the stage allows TOUCH_END to be detected and the correlation between that event and the sprite can be made via the touch id.

I guess that the TOUCH_BEGIN, TOUCH_MOVE, TOUCH_END sequence isn't guaranteed for a fast-moving swipe with listeners based on a Sprite/MC, but it is honoured over the lifetime of the swipe and requires listeners for TOUCH_END to be in place outside of the Sprite/MC itself.

I guess it's an indication of where touch handling differs from that of a pointer based interface.

Paul





On 26/05/2011 21:51, Paul Andrews wrote:
I've been using Flash CS5.5 targeting the IOS platform.

I have been writing a small application that relies on things being dragged around - can't really say much more right now.

I need to know when dragging starts, so on the thing that's being dragged I add a listener for TouchEvent.TOUCH_BEGIN.

I need to know when it's being moved, so the widget also has a listener for TouchEvent.TOUCH_MOVE.

And finally, I need to know when dragging stops, so the widget listens for TouchEvent.TOUCH_END.

Now mostly, everything goes OK, I get:

TOUCH_BEGIN, followed by one or more TOUCH_MOVE, and finally a TOUCH_END. Happiness.

I have noticed that sometimes if I drag too fast and/or gently do a swipe motion lifting my finger gently, the TOUCH_END doesn't seem to happen, so the app doesn't know that the user has stopped dragging. For the app, this is a problem because the user is allowed to position the widget roughly and on TOUCH_END it should snap into place.

Anyone else seen this?

I can imagine a workaround using a timer to catch missing TOUCH_END events, but it's a bit of a kludge.

Paul
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to