Re: [Flashcoders] Removing loaded swf...

2008-08-17 Thread Juan Pablo Califano
The last parameter - here set to true - makes the reference to your pageComplete function weak. Meaning if this reference is the only reference left to your removed object that object becomes ready for garbage collection. If I'm not wrong, technically, the function object could be removed

Re: [Flashcoders] Removing loaded swf...

2008-08-17 Thread Juan Pablo Califano
PD: On a second thought, I guess I misundertood the issue In this scenario: private function listenerFunc(evt:Event):void { } someDispatcher.addEventListener( someEvent, listenerFunc); listenerFunc has a ref count of 1 before adding it to someDispatcher (and that count will be 2 if I'm

[Flashcoders] Removing loaded swf...

2008-08-15 Thread Sander Schuurman
Hi cool list! I'm trying do build a generic structure of pages (swf's) loaded in a main swf, and unloading as well ofcourse. Now I'm trying to unload a loaded swf, with the famous Garbage Collection. But I'm not sure I'm doing it the right way. Hope you could point me in the right direction.

Re: [Flashcoders] Removing loaded swf...

2008-08-15 Thread Eduardo Omine
In gotoPage(), try this: var loader:Loader = Loader(currentPage.parent); instead of: var loader:Loader = Loader(e.target); // e.target refers to currentPage -- Eduardo Omine http://blog.omine.net/ http://www.omine.net/ ___ Flashcoders mailing list

Re: [Flashcoders] Removing loaded swf...

2008-08-15 Thread H
Hmm, Loader.unload() only removes the content from the loader object. It might be a good idea to remove it from the container you are adding it to. Make sure currentPage has no listeners to objects outside of its own scope, or objects inside of its scope listening to anything out of its scope, or

Re: [Flashcoders] Removing loaded swf...

2008-08-15 Thread dr.ache
Hi Sander. When you add an EventListener you should in 99% set the weak reference flag like this: mLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, pageComplete,false,0,true ); The last parameter - here set to true - makes the reference to your pageComplete function weak. Meaning

Re: [Flashcoders] Removing loaded swf...

2008-08-15 Thread Hans Wichman
Hi, I thought the point of Grant's article was that it's hopelessly bugged in player 9 even if you are an academic?:) greetz JC On Fri, Aug 15, 2008 at 3:47 PM, Eduardo Omine [EMAIL PROTECTED]wrote: In gotoPage(), try this: var loader:Loader = Loader(currentPage.parent); instead of:

Re: [Flashcoders] Removing loaded swf...

2008-08-15 Thread H
It is a bit like that isn't it :) H On Fri, Aug 15, 2008 at 9:13 AM, Hans Wichman [EMAIL PROTECTED] wrote: Hi, I thought the point of Grant's article was that it's hopelessly bugged in player 9 even if you are an academic?:) greetz JC On Fri, Aug 15, 2008 at 3:47 PM, Eduardo Omine