preOpenStack

Richard Gaskin ambassador at fourthworld.com
Sat May 8 07:23:10 EDT 2004


Dave Cragg wrote:

> At 11:20 am +0200 8/5/04, Webmaster - Dreamscape Software wrote:
> 
>> I have a "preOpenStack" handler setup in my main stack.  Everytime I 
>> open my
>> substacks, the "preOpenStack" message is sent not only to the 
>> substack, but
>> to the mainstack as well.
>>
>> Is this right?  How do I prevent this?
> 
> 
> It's right. A mainstack is in the message path of its substacks.
> 
> There are two common approaches to handling this.
> 
> The simple way is to put an empty (do nothing) preOpenStack handler in 
> the stack script of your substack.
> 
>   on preOpenStack
>   end preOpenStack
> 
> Or you can check for "the owner of the target" in the mainstack's 
> preOpenStack handler. Something like this:
> 
>   on preOpenStack
>     if the owner of the target is me then
>       ## do your stuff here
>     end if
>   end preOpenStack

And a third option:

If the mainStack has only one card, put the preOpenStack handler in the 
card script, leaving the stack script for common handlers.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com


More information about the use-livecode mailing list