Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-08 Thread Piers Cowburn
gleaf.com] On Behalf Of W.R. de > Boer > Sent: Monday, February 08, 2010 5:06 AM > To: Flash Coders List > Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak > references? > > Yes, but it can also cause a lot of trouble when used. I have had causes > where the e

RE: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-08 Thread Merrill, Jason
uary 08, 2010 5:06 AM To: Flash Coders List Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references? Yes, but it can also cause a lot of trouble when used. I have had causes where the event listener got deleted too early and then you spend a lot of time finding the issue. And that

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-08 Thread W.R. de Boer
Yes, but it can also cause a lot of trouble when used. I have had causes where the event listener got deleted too early and then you spend a lot of time finding the issue. And that was not with the Loader-class and Event.COMPLETE or others. ___ Flashco

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Christoffer Enedahl
Piers Cowburn skrev: That way, if I forget to remove the event listener in a destroy method or whatever, it should still end up eligible for GC. Cases where the event doesn't fire because a weak reference was used only happen if there are no strong references anywhere else, so the object right

RE: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Cor
f.com] On Behalf Of Steven Sacks Sent: zondag 7 februari 2010 23:34 To: Flash Coders List Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references? function onComplete(event:Event):void { event.target.removeEventListener(Event.COMPLETE, onComplete); } Easy

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Piers Cowburn
From: flashcoders-boun...@chattyfig.figleaf.com > [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven Sacks > Sent: zondag 7 februari 2010 4:32 > To: Flash Coders List > Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references? > > functi

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Steven Sacks
function onComplete(event:Event):void { event.target.removeEventListener(Event.COMPLETE, onComplete); } Easy peasy. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread wdb
Yes, I am doing the same because the trouble weak event listeners can cause. > function loadImage():void > { > var loader:URLLoader = new URLLoader(); > loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true); > loader.load(new URLRequest(url)); > } > function onComplete

RE: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Cor
: [Flashcoders] Re: is it ever ideal to NOT use weak references? function loadImage():void { var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true); loader.load(new URLRequest(url)); } function onComplete(event:Event):void { trace

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Henrik Andersson
Steven Sacks wrote: Guess what never fires? If you guessed "onComplete", you win the prize. You do realize that this is not guaranteed, right? It might not fire, but it may also do fire. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.co

Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-06 Thread Steven Sacks
function loadImage():void { var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true); loader.load(new URLRequest(url)); } function onComplete(event:Event):void { trace(event); } Guess what never fires? If you guessed "onComplete"

[Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-05 Thread jared stanley
sorry i'm an idiot it's all over google my apologies http://onflash.org/ted/2008/09/useweakreferencesboolean-false.php On Fri, Feb 5, 2010 at 9:33 PM, jared stanley wrote: > wondering why it defaults to false, seems like it really only affects GC, > so you'd want it set to true by default but m