I am trying to enable a swipe to the right on a locked field to activate an action.
I have used the following code:
Code: Select all
local sLastX, pID
on touchStart pTouchData
put pTouchData into pID
end touchStart
on touchMove pTouchID, pTouchX, pTouchY
put pTouchID into pID
-- sLastX[pTouchID] will be empty when the first move
-- message for pTouchID is sent
if sLastX[pTouchID] is empty then
put pTouchX into slastX[pID]
end if
if pTouchX > (slastX[pID] +10) then
swipeRight
breakpoint
end if
end touchMove
on touchEnd pTouchData
delete variable slastX[pID]
end touchEnd
Not even the breakpoint is activated (although that might be an issue with breakpoints)
I guess I am having trouble understanding the touchmove message.
There are examples of pinch decoding given in lessons and the forum but no examples of a simple swipe.
Can anyone help my aged brain with this?
James