Best way to stop an event sequence

Dar Scott dsc at swcp.com
Sat Jan 4 11:52:01 EST 2003


On Friday, January 3, 2003, at 10:07 PM, Sannyasin Sivakatirswami wrote:

> Hope that is not too vague.. a general example of "the best way" would 
> suffice.

There are lots of ways that can work; I wouldn't call one best.  Here 
is an idea:

Each step in your show can be started with a cue.  You might during 
development make a button to cue each step.  If each step is associated 
with an object then the script for its action can be in that object.  
Those scripts can also be in one place.

Steps can be made of smaller steps.  A bouncing ball might be 
independent in its sends but started and stopped by some outer control. 
  Also, some might be independent but parallel.

The end of each step can cue the next.  If the object itself cues the 
next, the cue buttons for debugging now essentially start the sequence 
from that point.  Alternately, the end of a step simply reports to the 
card that starts the next in the sequence if a sequence is in progress.

Define an abort handler for each object.  It either stops action or 
sets a flag stops it at the next opportunity which may be at the end of 
its step.  Aborting requires either a flag or a cancel ID or similar 
state.

The stop would then abort either the current or all objects 
participating in the show.

You might be able to define this recursively.  The show is owned by a 
group that contains all show objects or a proxy object for them.  It 
defines handlers "startSequence" and "abortSequence".  When done it 
sends "sequenceDone" to whatever started it (or to itself in 0 and let 
it fall to the card or stack).

Dar Scott





More information about the use-livecode mailing list