Read this:
--> Why does my initializer get shared across all instances like it's static?
http://osflash.org/flashcoders/as2

regards,
Muzak

----- Original Message ----- 
From: "James Tu" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Friday, May 25, 2007 12:46 AM
Subject: [Flashcoders] class member Array


> Has anyone encountered this before...
>
> If you have a class variable that is of type Array...
> DO NOT DO THIS:
> private var ListOfThings:Array = new Array();
>
>
> DO THIS:
> private var ListOfThings:Array;
> //then in your constructor, do this
> ListOfThings = new Array();
>
>
> If you do the former, Flash will create an Array that is SHARED  between all 
> instances of the class!!!  (i.e., it makes it STATIC)


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to