In the following code, in the windows simulator, I touch the ball and do not get a “began” event. When I lift my finger off the screen I get both a “began” and “ended” event at the same time. So I cannot trap the initial touch event until it’s over. Same if I use a runtime listener. Any idea what I’m doing wrong?
local ball = display.newCircle(150, 75, 15)
local function balltouch(event)
if event.phase == “began” then
print(“began”)
return true
elseif event.phase == “moved” then
print(“moved”)
return true
elseif event.phase == “ended” then
print(“ended”)
return true
end
return true
end
–Runtime:addEventListener(“touch”, balltouch)
ball:addEventListener(“touch”, balltouch)