Hi,
I wrote this test code.
The idea is that the circle flows out of the screen, removes itself and then creates its copy back onto the canvas and adds the tap listener. It throws an error. What am I doing wrong?
-- background local background background = display.newRect(0,0,1000,1200) background:setFillColor( 1 ) -- end background -- Create a circle local kolko kolko = display.newCircle( 200, 200, 60 ) kolko:setFillColor( 0.6,0.6,0 ) -- Destroy and recreate the circle on transition finished local function kolkofinished(obj) kolko:removeSelf( ) kolko = display.newCircle( 200, 200, 60 ) kolko:setFillColor( 0.6,0.6,0 ) kolko:addEventListener( "tap", tapkolko ) end -- Tap listener for the circle: start transition local function tapkolko (event) transition.to(kolko,{time=2000, y=-200, onComplete=kolkofinished}) end kolko:addEventListener( "tap", tapkolko )
Thanks!
