Transition question

i have this bug image that moves to these coordinates, is there any way i can make the bug go back to its original coordinates, then repeat the transition over and over and over?
local bug = display.newImage( “roach.png” )
bug.x = 250
bug.y = 130
transition.to(bug, {time=1000, x = 150, y=150}) [import]uid: 10827 topic_id: 4590 reply_id: 304590[/import]

Use the onComplete argument of the transition.to to call another function that transitions the bug back and have that transition.to have another onComplete argument that calls a function that moves the bug again.

Then the two transition.to functions will ‘ping pong’

Here’s my code or example:

[blockcode]
function doCrossBarUp()
print(“doCrossBarUp()”)
crossbardown = nil
crossbarup = transition.to( crossBar, { time=20000, delay=2000, y=12, onComplete=doCrossBarDown} )
end

function doCrossBarDown()
print(“doCrossBarDown()”)
crossbarup = nil
crossbardown = transition.to( crossBar, { time=20000, delay=crossBarDelay, y=display.contentHeight/3, onComplete=doCrossBarUp} )
end

[/blockcode]

Hope that helps. [import]uid: 9371 topic_id: 4590 reply_id: 14474[/import]