|
-
Style Through Simplicity
Thanks a lot really helps. This will make learning AS3 a lot less tedious. Keep them coming if you can .
Ali
-
I checked the link out Fall_X, however I am pretty sure there is no way to know when an object has be deleted. Objects with event listeners attached will not be deleted by the GC. I could be wrong, but tests I have done have shown that they wont get deleted.
I've just added a small article about the GC about removing your references.
I'm glad you like them, I will definitely make more. I plan to get a couple more up by Saturday.
-
 Originally Posted by jason merchant
I checked the link out Fall_X, however I am pretty sure there is no way to know when an object has be deleted. Objects with event listeners attached will not be deleted by the GC. I could be wrong, but tests I have done have shown that they wont get deleted.
I've just added a small article about the GC about removing your references.
I'm glad you like them, I will definitely make more. I plan to get a couple more up by Saturday.
Yeah, that's right, I know, but it's something people should be aware of - if you want to remove a movieclip (or sprite), you need to check that you :
- remove it from it's parent (removeChild)
- remove all event listeners
- stop all sounds it has playing, and delete the references to them
- either unparent all it's children or delete/null all references to it's children (and remove events on the children as well), or both - keeping references to it's children while they are still parented to it, means you still have a reference in the parent property of the children, which means no GC
- delete/null all references to it
That should do the trick in most cases. It's a bit tedious, but important.
If I'm not mistaking, unparenting all it's children will make the GC delete it a bit faster, ie on the normal pass. If, on the other hand, you decide to keep the children parented but delete all references to it's children, there's a circular reference thing going on, and it will only get deleted on the next mark and sweep pass - but I'm not sure about this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|