Hey Coronans out there! 
I ve got the following problem:
I place a picture on the screen and add an EventListener to it. If the user touch the pic the pic should disappear and after a delay it should appear again at a random position. So far, so good.
local removePic = function( event ) local t = event.target; local phase = event.phase; if "began" == phase then t:removeSelf(); picTimer(); end return true end local function setPic() pic = display.newImage( "erdm.png", true ); pic.y = math.random(400, 700); pic.x = math.random(50, 1000); pic.width = 50; pic.height = 100; pic:addEventListener( "touch", removePic ); end local function picTimer() timer.performWithDelay( 1000, setPic, 1); end picTimer();
I know that the removePic-function “dont know” the picTimer()-function so an error occurs.Â
But whats the best way to construct something like this? :wacko:
Thanks in advance!