suppose there is an obj say crate
crate=display.newImage(crate.png)
crate.x=display.contentWidth/2;
crate.y=display.contentHeight/2;
local function moveRight(event)
transition.to(crate,{time=2000,x=display.contentCenterX/2+200,onComplete=moveleft});
end
local function moveleft(event)
transition.to(crate,{time=2000,x=display.contentCenterX/2+200,onComplete=moveleft});
end
moveRight();
suppose there are 10 other objects each require a different transition.to function with oncomplete parameter then how can we do it instead of creating similar function like above for each object? also is there any other way of calling this function when we use scenes instead of writing moveRight().
