Hi bjb007,
It sounds like what you want to do, if I'm following you, is to:
- Exectue some handler repeatedly while your button is in a certain state; and
- Get out of that state and disable execution when the user clicks the button again.
Rather than imbed the send command in a repeat loop it's usually better to use the
send in time construct, then have the called handler call itself unless your state has ended. It would go something like this:
Code: Select all
on mouseUp
if the label of me is "Auto Off" then
set the label of me to "Auto On"
send "mouseUp" to button btnNextNumber
else
set the label of me to "Auto Off"
end if
end mouseUp
Then in the called button:
Code: Select all
global gMsgID -- could be 'local' if you never call it from other scripts
on mouseUp
-- do stuff here
if the label of btn "theOtherBtn" is "Auto On" then
send "mouseUp" to me in 1 second
put the result into gMsgID"
else
cancel gMsgID -- cancels any pending messages
end if
end mouseUp
For a discussion of the
send in time construct, see my web site
http://revolution.byu.edu .
Click on Revolution Tutorials by Topic, then Scroll down to "Working with Dates, Time and Timing" and click on the link for "Executing Time-delayed or Repeating Events".
HTH
Devin Asay