help with flushevents on ios or best suggestions

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kev
Posts: 1
Joined: Sat Oct 29, 2011 9:58 am

help with flushevents on ios or best suggestions

Post by kev » Sat Oct 29, 2011 10:17 am

hi,

I am working on an ipad app right now. At the beginning, the instructional direction will be given. I don't want the users to touch the button to move to the next card during the direction.

Here is what I have done:

The script of the card:

Code: Select all

on opencard
play (specialfolderpath("engine") & "/start.aiff")
wait until the sound is done
put flushEvents("mouseUp") into temp
end opencard
The script of the button:

Code: Select all

on mouseup
go to card 7
put flushEvents("mouseUp") into temp
end mouseup
With this code, the button did not work during the direction. However, if I clicked the button during the direction, after the sound is done, it automatically went to card 7.

I searched the forum, and tried what Klaus suggested in a similar situation:

set a nonmouseclicks first

on the card

Code: Select all

on opencard
 insert script of btn "nonmouseclicks" of cd 3 into front
play (specialfolderpath("engine") & "/start.aiff")
wait until the sound is done
remove script of btn "nonmouseclicks" of cd 3 from front
end opencard
However, the same problem happened. I also tried disable/ enable the button, but still cannot solve the problem.

Can anyone here help me?

Thank you.

Kev

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

Re: help with flushevents on ios or best suggestions

Post by Dixie » Sat Oct 29, 2011 10:39 am

Hi...

Instead of using 'flushEvents', use 'iphoneClearTouches' ... as it says in the 'release notes'
'Note that this also cancels any existing mouse or touch sequences, meaning that you (nor the engine) will not receive a mouseUp, mouseRelease, touchEnd or touchCancel message for any current interactions.'
be well

Dixie

Post Reply