Move object towards touch

How can I make an object move towards the touch event? I don’t want the object to just appear at the touch event, rather I want the object to move to the touch event. [import]uid: 74059 topic_id: 21714 reply_id: 321714[/import]

on touch capture x,y
in enterframe do math to calculate distance from obj.x and obj.y and move the object to capture.x,capture.y

c
[import]uid: 24 topic_id: 21714 reply_id: 86206[/import]

To add to what Carlos said

instead of using enterFrame, you can even use transition.to to the touch points.

The only problem with using transitions is that if you do not calculate the speeds, the object will either crawl or rush to the spot depending on the distance and time.

[import]uid: 3826 topic_id: 21714 reply_id: 86231[/import]