Hey y'all,
Still a complete beginner in terms of coding and I'm having some trouble figuring out how to swipe between cards. I would like to be able to touch anywhere except for a border along the top and bottom and be able to swipe left or right. Any code or help is greatly appreciated!
Thanks,
Clanton
Code Help for Swiping between cards
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Code Help for Swiping between cards
Hey,
Is this what you're looking for?
Let me know if it works as I'd like to use it myself when I modify my app to be compatible with touchscreen.
Regards,
Ivan
Is this what you're looking for?
Code: Select all
global sStartH
on mouseDown
put the mouseH into sStartH
end mouseDown
on mouseUp
if abs(the mouseH - sStartH) > 50 then
if the mouseH < sStartH then
goNext
else
goPrev
end if
end if
end mouseUp
command goNext
go next cd
end goNext
command goPrev
go prev cd
end goPrev
Regards,
Ivan
Re: Code Help for Swiping between cards
Read here: http://livecode.wikia.com/wiki/Swipe
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w