how to do continous action on corona in tap function
snippet in lua
how to do continous action on corona in tap function
user7746
local function onEnterFrame(event)
ball.y = ball.y + 2
end
local function onTouch(event)
if (event.phase == "began") then
Runtime:addEventListener("enterFrame", onEnterFrame)
elseif (event.phase == "ended") then
Runtime:removeEventListener("enterFrame", onEnterFrame)
end
end
button:addEventListener("touch", onTouch)