>i'm a little embarassed to ask this

Hey, don't be embarrassed--like somebody recently remarked, the only dumb 
question is the one you don't ask.

>i want to create a child object from a parent script and be able to refer to
>it globaly using a string that i pass to it!  i want to give all these
>children their own individual names and be able to call them individually!
>
>a related question is.. how can i globalize variables?

I'll answer your second question first:

global goFirstObject
global goSecondObject

or, you could just do:

global goFirstObject, goSecondObject

Purely style preference. I like to see at a glance how many globals I have, 
so I tend to declare them individually.

Now, to create the object:

   goFirstObject= script ("mParentScript").new()
   goSecondObject= script ("mParentScript").new()

And you have two objects, each created from the same parent script. The 
global variables goFirstObject and goSecondObject contain the reference to 
the object. So, if you had a handler in mParentScript called, say, moveMe, 
you would call it with:

goFirstObject.moveMe(x, y)

Does that answer your questions?

Cordially,
Kerry Thompson


[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