Page 1 of 1

Stopping Repeated clicks

Posted: Sat Mar 23, 2013 10:47 pm
by maxs
Hi All,

OK if a user accidentally clicks on a button 3 or 4 times, I want the script to execute only once. Once the scripts has been executed, then the user can click again.

OK I tried using this script at the beginning and end of a mouseup command, but it did not work.

if the pendingmessages is not empty
then
exit to top
end if

Any ideas? I've had this problem for years. I feel like I'm the only person in the history of programming who sees this as a problem.

Max

Re: Stopping Repeated clicks

Posted: Sat Mar 23, 2013 11:24 pm
by bn
Hi Max,

try

Code: Select all

 get flushevents("mouseUp")
look at flushEvents in the dictionary.

Kind regards
Bernd

Re: Stopping Repeated clicks

Posted: Sat Mar 23, 2013 11:26 pm
by Dixie
maxs...

put a button and a fld on a card... put the followinf script into the button..

Code: Select all

local ImBusy

on mouseUp
   if ImBusy = 1 then exit mouseUp
   put empty into fld 1
   DoTheStuff
end mouseUp

on DoTheStuff
   put 1 into ImBusy
   repeat with count = 1 to 4
      wait 2 seconds
      put count & space after fld 1
   end repeat
   get flushEvents("mouseUp")
   put 0 into ImBusy
   beep
end DoTheStuff
Does that do what you wish ?

Dixie

Re: Stopping Repeated clicks

Posted: Sun Mar 24, 2013 2:35 am
by maxs
Thanks Dixie, and Bernd,

This really does the trick. Thank you so much.

Max