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 »

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 »

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 »

This might help... :-)
Attachments
swipes.livecode.zip
(2.12 KiB) Downloaded 363 times
michel_bujardet
Posts: 45
Joined: Mon Apr 21, 2014 10:41 am
Contact:

Re: Swipe image left and right

Post by michel_bujardet »

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 »

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 »

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