Hi, its my first post here, and i found the corona a really interesting framework to work with.
Scenario: I have an object which has touch event registered. i want the touch event to perform two different behaviours based on the the touch e.g short touch(like a tap) and long touch. if a user just tap it i want it to call one function other wise call another function. here is the code i have written to tackle this problem. However it is executing the climbDown only one time and not after the intervals specified. i know even if a long tap is presed it still execute climbUp().
Question: How to i use the same object to execute climbUp method when he just tap the object and to execute another method when he tap for long.
CODE:
local function countTaps(event)
if event.phase == “began” then
climbUp()
timeClimb = timer.performWithDelay( 150, climbDown )
return true
elseif event.phase == “ended” then
timer.cancel(timeClimb)
end