How di I prevent a double click action in IOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

How di I prevent a double click action in IOS

Post by FireWorx » Mon Apr 16, 2012 8:44 pm

Hi,
I have a list style object on card 1 that when clicked takes you to card 2. Card 2 has a large clickable image rect area on it that the user can select from to perform further actions and then goes to card 3.

This all works great in the IDE and as well in IOS if the user taps once on the list object in card 1. However if the user double taps the list object in card 1 he is transported to card 2 and then the second tap (issued on card 1) immediately triggers the clickable image script (on card 2). Immediately taking you to card 3.

Any ideas on how to prevent the double click action from triggering on the new card?
Dave

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4177
Joined: Sun Jan 07, 2007 9:12 pm

Re: How di I prevent a double click action in IOS

Post by bn » Mon Apr 16, 2012 9:10 pm

Hi Dave,

would iphoneClearTouches at the end of the handler that makes the transition to card 2 (touchEnd? mouseUp?) help?

from the iOS release notes:
Clearing pending interactions
As interaction events (touch and mouse messages) are queued, it is possible for such messages to accumulate when they aren't needed. In particular, when executing 'waits', 'moves' or during card transitions.
To handle this case, the iphoneClearTouches command has been added. At the point of calling, this will collect all pending touch interactions and remove them from the event queue.
Kind regards

Bernd

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: How di I prevent a double click action in IOS

Post by FireWorx » Mon Apr 16, 2012 9:30 pm

Yes that works perfectly. Thanks for the quick response!
Dave

Post Reply