Page 1 of 1

Swipe question.

Posted: Wed Feb 27, 2013 6:04 pm
by atmosk
I started using livecode about couple days ago for an app and among the first things I attempted to do was swiping from card 2-4 (sub menus) back to card 1 (main menu).

Currently I have this.

Code: Select all

on openCard
   global startingPositionX,startingPositionY
end openCard

on mousedown
   global startingPositionX,startingPositionY
   put the mouseH into startingPositionX
   put the mouseV into startingPositionY
end mouseDown

on mouseStillDown
   global startingPositionX,startingPositionY
   local distanceX, distanceY
   put abs  (the mouseH - startingPositionX) into distanceX
   put  abs (the mouseV - startingPositionY) into distanceY
   if distanceX > 200 then
      go to card "Main Menu"
   end if
end mouseStillDown
It works on most pretty decently, given a few problems which I've figured already and I imagine others as well with some tinkering.

Now, my question is how would other people go about doing this? Is there perhaps a swipe message I could read in instead? Having the above code in virtually every card and control would get a bit too heavy? As a btw, the target platform currently is android/iOS.

Re: Swipe question.

Posted: Wed Feb 27, 2013 7:00 pm
by Dixie
the end result is the same... here is an example using the 'touch' command...

be well

Dixie

Edit : make sure that you post to the correct forum... or Klaus will shout at you !... :(

Re: Swipe question.

Posted: Wed Feb 27, 2013 7:04 pm
by Klaus
I gave up in this respect... 8)

Re: Swipe question.

Posted: Wed Feb 27, 2013 7:23 pm
by atmosk
Dixie wrote:the end result is the same... here is an example using the 'touch' command...

be well

Dixie

Edit : make sure that you post to the correct forum... or Klaus will shout at you !... :(
Thanks, works awesome and also learned tons of new stuff.
I thought this was the place to ask dumb beginners questions, sorry :(

Re: Swipe question.

Posted: Thu Feb 28, 2013 2:59 pm
by Klaus
No need to excuse, atmosk!

This is of course misleading, we have a special "iOS"and "Android" forum, but one need to scroll down this page to see them
and "Getting Started with LiveCode - Complete Beginners" is right on the top of the page and has this "inviting" description:
"Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode?
This forum is the place to go for help getting started. Welcome!"

:D


Best

Klaus