At 15:10 +0000 12/01/01, victor vina wrote:
>hi
>
>i pick up on the subject of OOP and whether there should be at least one
>global to keep track of the main manager object that births the rest.

You don't need the global, there plenty of more appropriate places, here's two:
--Birth your main object from a behavior on a dummy sprite
   (also gives you a convenient destructor method in the endSprite)
--stash your mainref in a property of a scriptmember.

Both of these methods keeps your namespace clean per movie.

>my approach uses ancestors to get rid of all the globals, but i'm not sure
>if i'm doing the right thing. for me it works so far, and lets me move the
>objects between movies without worrying about global variable's names.
>
>whenever i birth an object i declare the parent as an ancestor of the child.
>
>then, every time i want to access a handler on a higher object, i access it
>with me.whateverhandler() without having to worry if it is the immediately
>closer parent or another one further away in the hierarchy.
>
>is this a proper way of doing OOP?

If I understand you correctly, then yes.

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