Craig,

Director disposes the memory needed to represent an object when there are no more variables that point to that object. If you create an object and only set one variable to it:

myObjectRef = new(script "myObjectScript")

Then later you can release the memory needed for that object by doing this:

myObjectRef = 0 -- or VOID

However, if you set another variable to point to the same object, e.g.,

myObjectRef = new(script "myObjectScript")
someOtherVariable = myObjectRef

Then Director will only realease the memory for the object when both variables have been cleared.

Director keeps track of this by using a technique called a "refCount". For more details of how this works, check out the last part of chapter three of my on line book at:

http://www.furrypants.com/loope

Irv

At 4:36 PM -0500 1/4/03, Craig Taylor wrote:

Along the same lines, if I have placed an instance of an object into a
global variable, does it destroy the object when you zero that global out?
I know there has been discussion on this before, but I just wanted to verify
the proper procedure.

--

Lingo / Director / Shockwave development for all occasions. (Home-made Lingo cooked up fresh every day just for you.)
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/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