dunbarx wrote: ↑Wed Oct 12, 2022 6:23 pm
You can click all day and get lots of beeps.
Yes, but that's to be expected. It's no different than a user repeatedly clicking a button with your script. It's meant for long handlers that may cause the user to think the button did not respond, or for impatient users like small children who may click repeatedly while the handler is executing. It also prevents double-clicks.
To add a delay, wait an additional second or two (don't use "with messages") before flushing the queue.
Code: Select all
on mouseUp
evaluateVictory
wait 2 seconds
get flushEvents("mouseUp")
end mouseUp
@royF: there is no way the button script should respond unless the user clicks on the button itself. Something else is activating your handler, maybe you left remnants of the other suggestions in the script, or maybe you didn't put the mouseUp handler in the button itself. If the mouseUp is in the card script, it will trigger from anywhere.
If your evaluateVictory handler doesn't take long to execute, then the next click will trigger the button again. If you want a delay, use the "wait" command, though no matter how long you wait the user may just keep clicking anyway and eventually the button will trigger again.