Messages problem
Dar Scott
dsc at swcp.com
Sat Jul 24 11:46:59 EDT 2004
On Jul 24, 2004, at 9:06 AM, Jim Hurley wrote:
> on checkMouse
> (do some stuff) --Puts the mouseLoc into a field.
> if the mouse is down then
> (do something else as well) -- Places a marker at the mouseLoc.
> wait 5 ticks --I am using this line to keep ""something else" from
> happening more than once.
> end if
> send "checkMouse" to me in 10 millisec
> --This loop is halted with a "mouseDoubleDown" in the card script.
> end checkMouse
I might be mixed up on what you are trying to do.
To do "something else" only once each time the mouse goes down you can
try this. Set a script local flag in a mouseDown handler. Check it
and clear it in checkMouse. (I'm not sure if this is what you are
asking for.)
If the problem is multiple checkMouse cycles, you should see it in the
"Pending Messages" view of the message box. This is a common problem.
One approach is to keep the message id in a script local and have
checkMouse and its starting and stopping commands maintain that.
You might want to look at my "Message Mechanics" primer (very slightly
dated) that is here:
http://www.swcp.com/dsc/revstacks.html
Dar Scott
More information about the use-livecode
mailing list