This bug has stalled my finished game, please someone, a guru or corona staff help me with it please.
The bug is that corona doesn't register "cancel" or "end" event.phase on an object if you keep dragging over the object until you fall from the edges of that object. let me explain the bug with the following simple example...
local num = 0 local function bugFunc(event) if(event.phase == "began")then num = 1 end --WILL NEVER GET FIRED IF YOU DRAG OVER THE BUTTON UNTIL YOU ARE NOT TOUCHING THE BUTTON ANYMORE if(event.phase == "ended" or event.phase == "cancelled")then num = 0 end end local function bugTester() print(num) end --ButtonA local buttonA = display.newCircle( 150, 150, 50 ) buttonA.name = "buttonA" buttonA.alpha=0.3 buttonA:addEventListener ( "touch", bugFunc ) Runtime:addEventListener("enterFrame", bugTester)
In the above example the variable "num" will be always equal to "1" if you drag over the button until you are not touching the button anymore.