Pausing a simple animation
Jim Biancolo
webmaster at listology.com
Thu May 15 20:47:01 EDT 2003
At 06:24 PM 5/15/2003 -0400, you wrote:
>Ooops ... my fault. Let's try that again. Should have been "without
>waiting".
Ah, gotcha! Thanks for the follow-up. Unfortunately I already have
"without waiting" in there. I had (stupidly) snipped it in my first
example and represented it with an ellipsis because I didn't think it would
be relevant, but I did include it in my second example:
--- EXAMPLE ---
When I hit "play" this code runs:
on mouseUp
send animateTokens to card "myCanvas" in 10 milliseconds
end mouseUp
This invokes the handler:
on animateTokens
global b_play
put TRUE into b_play
repeat for each line L in field "frames"
set the lockMoves to true
repeat with i = 1 to the number of images in group "tokens_group"
move image i of group "tokens_group" to coords without waiting
end repeat
set the lockMoves to false
if not b_play then break
end repeat
end animateTokens
--- /EXAMPLE ---
With the code above, even with "without waiting", the "pause" button is
unclickable until animateTokens completes. What I want to be able to do is
click "pause" and set the global var "b_play" to FALSE, thereby breaking
the loop in animateTokens, but I'm good and stuck at the moment.
Thanks!
Jim
More information about the use-livecode
mailing list