I can't figure out why I'm getting this error on the below swiping code: "Execution error at line 5 (Operators-: error in right operand, character 15)
===============================================================
on mouseDown
put the mouseH into sStartH
end mouseDown
on mouseUp
if abs(the mouseH - sStartH) > 50 then
if the mouseH < sStartH then
go to next card
else
go to previous card
end if
end if
end mouseUp
=======================
Many thanks
What's wrong with this swiping code?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: What's wrong with this swiping code?
Hi,
try this:
Craig Newman
try this:
Code: Select all
on mouseDown
put the mouseH into sStartH
end mouseDown
on mouseUp
if abs(the mouseH - sStartH) > 50 and the mouseH < sStartH then
go to next card
else
go to previous card
end if
end mouseUp
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: What's wrong with this swiping code?
Hi Dunbar,
Problem with your solution is that a simple click will cause a move to previous card - because of the else aspect.
I think the problem is not with the structure of the original code - but simply that it needs a:
at the top of the script.
I have just tested the code here and that was all I added to make it work.
Hope that helps,
Dave
Problem with your solution is that a simple click will cause a move to previous card - because of the else aspect.
I think the problem is not with the structure of the original code - but simply that it needs a:
Code: Select all
local sStartH
... orig code here
I have just tested the code here and that was all I added to make it work.
Hope that helps,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.