Swipe image left and right

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Swipe image left and right

Post by michel_bujardet » Tue Apr 29, 2014 10:35 am

I have an app where images cover the entire card. Is there a way to move to next or previous card using horizontal swipe ?

I tried this in the image script but it never gets fired :

Code: Select all

on touchMove pTouchID, pX, pY
   if pX > lastX then
      -- user has moved to the right
      answer "moved"
   end if
end touchMove
I searched the board but was unsuccessful.

Any help will be appreciated. Thank you in advance.

Mitch
http://FontMenu.com

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Swipe image left and right

Post by LCNeil » Tue Apr 29, 2014 10:39 am

Hi Mitch,

You're on the right track.

This lesson has a section on implementing swipe gestures -

http://lessons.runrev.com/s/lessons/m/4 ... r-the-ipad

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Swipe image left and right

Post by Dixie » Tue Apr 29, 2014 11:35 am

This might help... :-)
Attachments
swipes.livecode.zip
(2.12 KiB) Downloaded 275 times

michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Swipe image left and right

Post by michel_bujardet » Tue Apr 29, 2014 12:59 pm

runrevneil wrote:You're on the right track.

This lesson has a section on implementing swipe gestures -

http://lessons.runrev.com/s/lessons/m/4 ... r-the-ipad
Thank you Neil. I had read the lesson but what through me out was that the swipe code was in the stack.

I have moved it to the image, and now messages work :) I should be able to figure it out...

Mitch
http://FontMenu.com

michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Swipe image left and right

Post by michel_bujardet » Tue Apr 29, 2014 1:00 pm

Dixie wrote:This might help... :-)
Thank you so much Dixie :)

Mitch
http://FontMenu.com

michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Swipe image left and right

Post by michel_bujardet » Tue Apr 29, 2014 7:04 pm

I have modified the code in the lesson to simplify it. It works fine with a script in the main stack.

Thank you for your help.

Mitch
http://FontMenu.com

Post Reply