question about mainStack scripts

Richard Gaskin ambassador at fourthworld.com
Tue Aug 30 07:45:09 EDT 2005


Lars Brehmer wrote:
> In my main stack there is a preOpenCard handler.  Now, every time one  
> of my many subStacks is opened, the preOpenCard handler of the main  
> stack tries to run, and since it involves objects unique to that  stack, 
> and the handler is trying to perform itself in the subStack,   I get an 
> error, something like "oject doesn't exist, "

The script of the mainstack is accessible from all substacks, acting as 
  a common repository of handlers, so what you're seeing is normal.

Three ways to have your mainstack-specific scripts only triggered in the 
mainstack:

- If the mainstack has only one card, consider putting the 
mainstack-specific scripts at the card-level.

- If the mainstack has multiple card you might consider adding a shared 
group and putting its mainstack-specific stuff there.

- You could also consider moving the mainstack and all of the substacks 
into a new mainstack which is kept fairly minimal; that way all of your 
stacks have their own discrete space, and you still have a mainstack to 
use as a central repository.

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list