I found a bug in transition.to, it doesn’t pass the object to onComplete function.
this example is taken directly from the corona docs…
local square = display.newRect( 0, 0, 100, 100 ) local w,h = display.stageWidth, display.stageHeight local listener1 = function( event ) local target = event.target print( "Transition 1 completed on object: " .. tostring( target ) ) end -- (1) move square to bottom right corner; subtract half side-length transition.to( square, { time=1500, alpha=0, x=(w-50), y=(h-50), onComplete=listener1 } )
The response is…
Transition 1 completed on object: nil