Hm yeah...I can't remember if I have memory problems or if I'm just
ignorant.
So I swap to object, don't need all the stuff stuffed with array.
jonathan howe a écrit :
Hi, laurent,
I'm missing why you can't just use the
for (prop in views) {
var view:Classname = views[prop] as Classname;
}
type syntax?
On Mon, Oct 27, 2008 at 10:25 AM, laurent <[EMAIL PROTECTED]> wrote:
I have a static Caddy Class that needs defferent views to show its content.
I think I really need to store them with a name, so I could make a viewsNum
to store how many views I got.
The thing is then I update all the views and need to iterate through the
whole views array/object. For that I should have an array of views with a
numeric index and so, no name storing them. Dilema
or I make two arrays one for the name, and another for the objects, with
same index.
or store the name in the CaddyView class and when calling a view by it's
name just look in views array with the one that have the good name.
I think all the case are here, which one do you want Paul ? :) thx
L
Paul Andrews a écrit :
If you want an associative array like that use Object, not Array. The
length of an array is the number of elements in the array, so it's 0.
obj["name"] is referring to an attribute of an object not an element of an
Array..
Do you really have to store values like that?
Paul
----- Original Message ----- From: "laurent" <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Monday, October 27, 2008 1:35 PM
Subject: [Flashcoders] AS3 associativ array length=0
Hi,
I use an array to store object with their name like that:
views[ "viewName" ] = Object
then views.length return 0 ...
It's normal behaviour ?? length work only on numerical indexes ?
L
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders