I have tried various ways of destroying instances.
I once used this type of implementation
// Parent Class
function buildChild() {
var myClass : MyClass = new MyClass();
myClass.addEventListener( "onDestroyChild", this );
}
function onDestroyChild( evt : Object ) {
if ( H
AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] destructors...
Yep - that works perfectly well. But it's always better to avoid
situations like this:
> Some of the developers used the same classes and
> slightly modified them for their needs.
by assigning different package na
Yep - that works perfectly well. But it's always better to avoid
situations like this:
Some of the developers used the same classes and
slightly modified them for their needs.
by assigning different package names to different modules, if you know
they'll all
be running in the same 'container' ap
gt;
Date: Thursday, May 4, 2006 9:36 am
Subject: Re: [Flashcoders] destructors...
To: Flashcoders mailing list
> Ian's right.
>
> ActionScript is a dynamic language with its own garbage
> collection, for
> better or for worse. If you try to apply all the same practices and
&
:09 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] destructors...
Wait though, isn't a class part of the swf compilation? Technically, you
really cannot delete it unless you load the class in via an external swf.
That might be one way of accually doing it.
M.
On 5/3/06, Andreas Røn
Good point.
I assumed - Andreas - that you were talking about deleting _instances_
of a class; not actual classes. :-)
Ian
On 5/4/06, elibol <[EMAIL PROTECTED]> wrote:
Wait though, isn't a class part of the swf compilation? Technically, you
really cannot delete it unless you load the class in
Wait though, isn't a class part of the swf compilation? Technically, you
really cannot delete it unless you load the class in via an external swf.
That might be one way of accually doing it.
M.
On 5/3/06, Andreas Rønning <[EMAIL PROTECTED]> wrote:
Kind of besides the point really. The real po
Ian's right.
ActionScript is a dynamic language with its own garbage collection, for
better or for worse. If you try to apply all the same practices and
rulesfrom strict-typed languages that requre manual memory management
you'll go
crazy. The best thing to do is to realize this type of languages
Um - I'm not sure it is beside the point. :-) Given that you are at
the mercy of the garbage collector, implementing a function like:
class MyClass
{
function cleanup()
{
delete _someProp;
delete _someOtherProp;
}
}
is pointless anyway, because if you delete an object of MyClass (or
rat
When using classes that extend from MovieClip, you can use onUnload().
I use it primairaly for removing EventListeners so I won't get stuck
with duplicate eventcalls.
When you want to delete a class all you really have to do is remove
all instances and references from that class. I don't think th
Kind of besides the point really. The real point is, in my humble
opinion, that it should be possible to do it without myClass.cleanup();
delete(myClass);
It becomes double naughty if your class instance is in an array.
It's just a question of keeping the amount of fluff down to a minimum.
This
Hi Andreas,
To turn it on its head...
What are you trying to achieve? In what circumstances do you need to
destroy a class?
Ian
On 5/3/06, Andreas Rønning <[EMAIL PROTECTED]> wrote:
has anyone got a good way for an as2 class to destroy itself? I know
it's not "possible", but my heart tells m
has anyone got a good way for an as2 class to destroy itself? I know
it's not "possible", but my heart tells me someone has devised some kind
of good methodology.
- A
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search
13 matches
Mail list logo