>Jon Rowe wrote:
>
>  >> I can't find a way to construct a movie without
>  >> using at least one global variable ... which holds
>  >> references to all the other objects and needs to
>  >> be accessible from all scripts.
>
>Another of many ways to do this is to use sprite 1, spanning the whole
>movie, as your top-level manager. You can replace calls into your global
>super-manager object with calls to sprite 1.

This is close to my preferred method.
I have a relatively simple behavior on sprite 1, which then creates 
and hold the top-level manager.
Usually all communication pathways are setup top-down, meaning that I 
rarely need to look up the reference to my topManager, because all 
objects have been fed a reference, at their creation.
If however I do need to look-up the topManager, I use sendAllSprites, 
and have a method in the main-carrier behavior to return the 
reference to the topManager.

I also find this quite convenient with regards, to 
creation/destruction, since this can be handled from 
beginSprite/endSprite.

In such a system I don't need any globals, meaning that the whole 
system can be considered as one encapsulated instance of an aggregate 
super object, meaning that there will easily be room for several 
systems simultaneously, should that ever occur.
It also means, that when working on group projects, I don't have to 
worry about the global namespace, since I am working completely 
within my own private namespace.

Jakob


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to