One important touch-based event that we haven't looked at yet in detail is TouchEvent.TOUCH_MOVE
. This event is fired whenever the user moves a finger across the screen and can be queried to determine the contact point's coordinates. Every time the user's finger changes position, a new TOUCH_MOVE
event is dispatched.
Although startTouchDrag()
and stopTouchDrag()
are recommended for dragging objects, you can instead update an object's position in response to TOUCH_MOVE
events.
Let us make some changes to the code from the Dragging multiple display objects recipe to do this.
If you haven't already done so, complete the Dragging multiple display objects recipe before proceeding.
You can continue to work with your code from that recipe. Alternatively, from the book's accompanying code bundle, open chapter5\recipe4\recipe.fla
into Flash Professional and work from there.