views:

41

answers:

1

Just a short question:

can Vectors be associative, like Array's?

probably not, because I tried, but maybe there's a workaround...?

+1  A: 

Hello,

In ActionScript 3, Arrays (and Vectors) may only have numeric indexes. They may be considered associative in the sense that the indexes don't need to be consecutive, but you can't use string indexes.

Regards, Alin

Alin Purcaru
Well this works with Arrays: var t:Array = []; t["test1"] = "test1"; t["test2"] = "test2"; t["test3"] = "test3"; t["test4"] = "test4";
You can do that on any object but it doesn't mean the elements are added to the array, they are just created as properties of that object.
Alin Purcaru