after four or five days blocked with the vertical scroll, i decided to try another thing as i am not seeing the light...
So i decided to use 'swipe up and swipe down' in place of the vertical scroll...
I am already using 'swipe right and swipe left' and it is working well...
But now i am not managing when i am adding the swipe up and down...
i put the sentence "-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE" after all the lines i added to control the swipe up and down...The rest was already working for swipe left and right.
This is the code i have:
Code: Select all
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
put pY into sInitY-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
put pY - sInitY into tDistanceY-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
else
if abs(tDistanceY) > sSwipeDistance then-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
if tDistanceY < 0 then-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
send "swipeDown" to me in 0 millisecs-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
else-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
send "swipeUp" to me in 0 millisecs-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
end if-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
end if-- NEW LINE ADDED FOR THE UP AND DOWN SWIPE
end if
end if
end touchMove
What i want is go to card 1 when i swipe up
go to card 2 when i swipe down
go to card 3 when i swipe left
go to card 4 when i swipe right
Is it possible to do what i am trying???If yes, what is the error of my code?
Regads.