Re-3: abort scripts
Scott Rossi
scott at tactilemedia.com
Wed Jun 13 17:33:54 EDT 2007
Recently, runrev260805 at m-r-d.de wrote:
> I have a stack with one card. The card contains 4 Buttons. 3 Buttons start
> routines, which take about 5 minutes each to finish. Clicking on the fourth
> button shall abort the running sript of the button, which was pressed.
>
> Thought, i could solve this with 'send "exit to top" to button btnToStop',
> where btnToStop contains the button name. But this does not work.
>
> How can i achieve this?
Assuming your routine is a loop of some kind, you could do it by setting a
custom property of the card, similar to this:
[routine button scripts]
on mouseUp
set the allowProcessing of this cd to true
doMyRoutine
end mouseUp
on doMyRoutine
if not the allowProcessing of this cd then exit to top
-- do myStuff
send "doMyRoutine" to me in 5 millisecs
end doMyRoutine
[cancel button script]
on mouseUp
set the allowProcessing of this cd to false
end mouseUp
Regards,
Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
More information about the use-livecode
mailing list