for movieclips i tend to override removemovieclip myself. just a personal
pref i suppose :)

On 10/3/06, Mike Keesey <[EMAIL PROTECTED]> wrote:

The term is a "destructor"; and, no, ActionScript doesn't have
destructors, only constructors. The closest it comes is
MovieClip.onUnload()--if your class is a subclass of MovieClip, then you
can just override that. If not, one common practice is to make a
function called destroy():

public function destroy():Void {
        // Perform clean-up.
        delete this;
}

Then replace all instances of "delete instanceOfYourClass;" with
"instanceOfYourClass.destroy()".

―
Mike Keesey

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of grimmwerks
> Sent: Monday, October 02, 2006 6:34 PM
> To: Flashcoders mailing list
> Subject: [Flashcoders] when classes die...
>
> Ok, I've got an app that uses a static variable; I've got 'templates'
> that use x instances of this class.
>
> When the user loads in a new template when a previous template has
> already existed, I get some 'leftover' variables.
>
> Is there a function that is called when a class is 'killed', ie the
> opposite of when a class is birthed with 'new'?
>
> --
> -------[ http://www.grimmwerks.com
> -------[ [EMAIL PROTECTED]
> -------[ [EMAIL PROTECTED]
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
j:pn
http://www.lennel.org
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to