marksmithhfx wrote: Thu Jul 30, 2020 2:43 pm
Hi Jim, I'm going down the same path. Is it possible to post an example of your solution?
Thanks
Mark
Here's what I use... so simple as to be embarrassing.
In card script so I don't accidentally have swiping when not wanted on card.
As I said, people seem to figure out you can't swipe on another object (scroller).. a little swearing till they figure it out then good....
Make sure user can actually access card... no blocking fields, etc.
Need 50+ pixels to get a swipe. Could change.
NOTE: Seems only scrollers don't react to this approach. I use same script in graphics and groups to trigger other behaviors...
############################
## Touch data
##############################
local lStart,lFinish
########################
## TOUCH BASED SWIPE ###
########################
on touchStart theID -- Initiate the swipe
put empty into lStart
put empty into lFinish
end touchStart
on touchMove theID, pH -- Capture start and end points
if lStart is empty then
put pH into lStart
else
put pH into lFinish
end if
end touchMove
on touchEnd theID
-- The next line is included if you want to do something depending on which card you're on (e.g. go Home if o the first of a series of cards)
put word -1 of the short name of me into tWhichIntro
if lStart is not empty and sFinish is not empty then
if lStart > lFinish and abs(lStart - lFinish) > 50 then -- A real swipe..... swipe left, go next card
visual effect push left very fast
go next cd
else if lStart < lFinish and abs(lStart - lFinish) > 50 then -- A real swipe..... swipe right, go preview card
visual effect push right very fast
go prev cd
end if
end if
put empty into lStart
put empty into lFinish
-- mobileClearTouches Included this but never have had trouble with too many swipes in queue. Still good idea?
end touchEnd