scripting simultaneity

kweto nrkweto03 at
Wed Jul 7 23:12:01 CDT 2004


On my stack, clicking a single button causes two animated gifs (spinners) to
start moving frame by frame. Moreover, because frame speeds for both these
"spinner" images need to randomly vary and thereby reproduce a "natural"
slowing down effect, that same start-button's script uses "set the
currentFrame to x" to step the gif's thru each frame instead of merely
letting them run their course "naturally" at their own built-in frame speed.

Anyway, that part of the script I've got worked out -- thanks to prior
advice from the list.  The difficulty now is how to script a simultaneous
effect within the one button's script, so that one spinner keeps spinning at
a constant rate while the other spinner begin to slow down and eventually
stop, at which point the first spinner too begins to slow and stop.

That sounds confusing even to me, so maybe I should outline the basic
overall process I'm after:

(STEP 1)
Click a start button to begin moving animated gif A and animated gif B at
the same per-frame rate;

(STEP 2) When the start button is released:
  (a) animated gif A begins to slow down at a randomly set"deceleration"
speed, while
  (b) animated gif B continues spinning in the background at a constant

(STEP 3) When animated gif A is eventually stopped, animage gif B also
begins to "decelerate" at a randonly set per-frame speed, and eventually

(STEP 4) Display the two results as determined by each animated gif's final
position (i.e., its currentFrame property)

I hope that all makes sense :-)


Nicolas Cueto

More information about the use-livecode mailing list