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
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
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
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
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
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
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
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
: [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
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
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"
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
12 matches
Mail list logo