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
; 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
Of Johannes Nel
Sent: Tuesday, October 03, 2006 11:14 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] when classes die...
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
onUnload is a better way to do it, make no mistake, it gets called a lot
more consistantly - i do agree with that completly.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
now i remember why i did removemovieclip instead of onUnload... sorry been
doing flex for a loong time...
if the parent is removed onUnload does not fire, with overriding
removemovieclip i could pick up all the child clips and call removemovieclip
on them allowing me to clean up bottom up and
public function destroy():Void {
// Perform clean-up.
delete this;
}
This code is garbage. The delete operator operates on variables and
not on values. So delete this will just delete a variable called
this within the scope of that function. To remove an object from
memory, you
: Tuesday, October 03, 2006 3:55 PM
Subject: Re: [Flashcoders] when classes die...
public function destroy():Void {
// Perform clean-up.
delete this;
}
This code is garbage. The delete operator operates on variables and
not on values. So delete this will just delete a variable
it to undefined?
―
Mike Keesey
-Original Message-
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Peter Hall
Sent: Tuesday, October 03, 2006 3:55 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] when classes die...
public function destroy():Void
Is there any difference at all between deleting a variable and setting
it to undefined?
There is a difference. But you won't find many occasions where the
difference is apparent. (one example is a for..in loop will iterate
over a variable whose value has been set to undefined - and that might
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
No. Write a method that does cleanup.
Scott
On 02/10/06, grimmwerks [EMAIL PROTECTED] wrote:
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
11 matches
Mail list logo