How to get the position of a moving object?

Hello, i have one question, i was looking for it in corona apis and i didnt find it. So how do i get the position of a moving object?

At any point on time you can declare a variable and set its value to object.x and another variable to object.y - do you need a hand setting up a function that runs constantly to perform this task?

Well i used the transition.to and i need to get the position while the object is moving.

You can always access the position with object.x and object.y

Example:

[lua]local obj = display.newRect(0,0,100,100)

transition.to(obj, {y = 1000, time = 3000})

timer.performWithDelay( 100, function() print(“y position”, obj.y) end, -1)[/lua]

At any point on time you can declare a variable and set its value to object.x and another variable to object.y - do you need a hand setting up a function that runs constantly to perform this task?

Well i used the transition.to and i need to get the position while the object is moving.

You can always access the position with object.x and object.y

Example:

[lua]local obj = display.newRect(0,0,100,100)

transition.to(obj, {y = 1000, time = 3000})

timer.performWithDelay( 100, function() print(“y position”, obj.y) end, -1)[/lua]