moving object from A to B to C when touch a buttom ?

Hi, new here but very excited.
I want to move a object from position A (x=0,y=50) and when finish the movement then go to B (200,50) and when finish the movement go to C (200,200) all this when I touch a Buttom for first time.

I´m new in Lua and this is what I do but only move when I hit the button but this is not what I want. Also I want to do it without Physics. Only moving the object. Can I do that ???

local Flecha = display.newImage( “FlechaAdelante.png” )
local function Toca (event)
if event.phase == “ended” then
if Flecha.x < 200 then transition.to( Flecha, { time = 2000, x = 200, y = 50} ) end
if Flecha.x >= 200 then transition.to( Flecha, { time = 2000, y = 200} ) end
if Flecha.y >= 200 then transition.to( Flecha, { time = 2000, x = 400} ) end

end
end

Flecha:addEventListener (“touch”, Toca)
Please helpme !!! and sorry my poor english. [import]uid: 47289 topic_id: 8718 reply_id: 308718[/import]

Hello, i’m also new to Corona SDK and programing in general, i think you know more than me but i seen this some where and i have tested this and i think it seems to work you try it, hope it work and if it does maybe one day you can help me since im dying tp learn to program:

[code]
local ball = display.newImageRect( “images/ball.png”, 50, 62 )
ball.x = 240; ball.y = 188

local function ballAni()

local animUp2 = function()
ballTween = transition.to( ball, { time=400, x=250 })
end

local animUp = function()
ballTween = transition.to( ball, { time=400, y=250, onComplete=animUp2 })
end

ballTween = transition.to( ball, { time=400, x=200, onComplete=animUp })
end
ballAni()
[/code] [import]uid: 45615 topic_id: 8718 reply_id: 31790[/import]

Thanks very much cobra12512, I don´t know if this is the “perfect” way to archive my goal but IT WORKS !!

So for me is perfect, perhaps some day I could return the favor, but now I am very grateful to you.

I know it is a silly question but I had hair pulling me the last days.

Thanks again. [import]uid: 47289 topic_id: 8718 reply_id: 31794[/import]

I’m glad this work for you, since i’m not a programer just a learner i’m glad i was able to help you out… I’m still trying to learn this Lua programing, is harder for me since i never coded but i do know some basic stuff, really, really basic lol… [import]uid: 45615 topic_id: 8718 reply_id: 31827[/import]