Stopping a buttons actions

Scott Rossi scott at tactilemedia.com
Thu Feb 27 17:43:01 EST 2003


Recently, "Tim Hart"  wrote:

> I have a button which starts a script that takes about two minutes to
> get through.  I am scrolling through pictures with it.  My problem is
> stopping in the middle.  How can I stop or pause once the button is hit
> so I don't have to wait 2 minutes.

Depends on what your script is actually doing.  If you're running a
repeating/looping action, you can simply check a variable/property state at
the beginning of your loop.  You must be using "send in..." to accomplish
this reliably.

# TO START YOUR SCROLL ACTION, SEND A
# "DOTHESCROLL" MESSAGE TO WHEREVER
# YOU PLACE THE FOLLOWING SCRIPT.

# IN YOUR CARD/STACK
on doTheScroll
    if not the uAllowScroll of this stack then exit doTheScroll
    runMyScrollStuff
    send "doTheScroll" to me in 50 milliseconds
end doTheScroll


# IN YOUR STOP BUTTON
on mouseUp
    set the uAllowScroll of this stack to false
end mouseUp

on mouseRelease
    mouseUp
end mouseRelease
    

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list