Is there a way to cancel all subsequent phases of a touch event?

I have some transitions and animations where touches are briefly disabled (around 500ms), because it messes things up if the user touches during that time. At first, I put a simple check at the beginning of all my touch listeners like this:

[lua]function touchHandlerOne ( object, event )

– quit if touches are disabled
if getVar( “levelVars.touchEnabled” ) ~= true then
return true
end

– rest of function…
end[/lua]

The problem was if the user touched during the “touch disabled” time, then kept their finger down until touches were re-enabled, the touch handlers would see a “moved” or “ended” phase, with no “began” phase, which messed things up.

So I did this, which resolves it, but is a bit awkward:

[lua]function touchHandlerOne ( object, event )

– quit if touches are disabled (and store this touch so the other phases don’t get used)
if getVar( “levelVars.touchEnabled” ) ~= true then
setVar( “levelVars.invalidTouch”, event.id)
return true
end

– quit if this is a “bad touch” (one that started or moved when touches were disabled)
if event.id == getVar( “levelVars.invalidTouch” ) then
return true
end

– rest of function…
end[/lua]

But is there another, “cleaner” way to essentially cancel or “kill” an entire touch event - so that the system will ignore all subsequent phases of that touch? [import]uid: 49372 topic_id: 12904 reply_id: 312904[/import]