I’m trying to get a display object to move right across the screen on its own when I touch the “fooRight” object. Below is the snippet of the code that I’m trying to fix. I assume that the function activateRight is the issue.
function activateRight () foo.x = foo.x + 10 if foo.x \> 320 then foo.x = 0 end end function touchRight(event) if event.phase == "began" then Runtime:addEventListener("enterframe", activateRight) elseif event.phase == "moved" then Runtime:addEventListener("enterframe", activateRight) end end fooRight:addEventListener("touch", touchRight)