ok, i have *again* some arrays troubles...

here's an example of what i have:
Code:
label = new Array()
label["rrr"] = ["money", "a", "a", "a"];
label["sss"] = ["money", "a", "a", "a"];
label["ttt"] = ["gold", "a", "a", "a"];
label["uuu"] = ["money", "a", "a", "a"];
label["vvv"] = ["gold", "a", "a", "a"];
label["www"] = ["gold", "a", "a", "a"];
label["xxx"] = ["money", "a", "a", "a"];
label["yyy"] = ["gold", "a", "a", "a"];
label["zzz"] = ["silver", "a", "a", "a"];
^ here's a collection of arrays that is quite similar to what i need for my game. the value that i want to work with is the value [0]. in this example, it can be "money", "gold" or "silver".

now, i want to create another array that will sort all these [0] values, and group them depending on this value; so there will be an array holding all the array's names having "money" as [0], another "gold" and another "silver"; as a result, 3 new arrays.
...sorry if it's not clear enough. basically, i want to check the collection of array above and look for all the ones that have "money" as [0] for example.

since i cannot work with a for loop combined with the label.length (because they are not called label[0], label[1], label[2] etc... the length isn't working), how can i do that?

> my solution is to have another array holding all "rrr", "sss", "ttt" ... "zzz" values and perform a for loop thanks to it. something like that:
Code:
label_check = ["rrr", "sss", "ttt" ... "zzz"];
BUT i have something like 40/50 arrays each time, so sorry i absolutely don't want to rewrite them all that way!!! ^^

is there a solution? thanks a lot if you can help...