[MX] Dynamically named variables!

Hello all,

Obviously I’m trying to do something and doing it wrong (again)…

The idea is: Dynamically named Object, with a dynamically named Array, with a dynamically named Array.

[AS]function sortData(stateAbbr){
menuItem = “menu” + stateAbbr;
this[menuItem] = new Array();
for (i=1; i<queryResults.getRowCount();i++){
store = “store” + i;
this[menuItem][store] = new Object();
this[menuItem][store].name = queryResults.getField(i, “STORENAME”);
this[menuItem][store].city = queryResults.getField(i, “ADDRESSCITY”);
}
}[/AS]

So, if stateAbbr = “CA”, i should be able to say: trace (menuCA.store3.name); and get back whatever is held there, right?

When I started up Flash, it told me, “Fear not the ob-stacles in your way, for fate has vouchsafed your reward”. I don’t know exactly what that means, other than maybe I’ve been spending too much time with Flash…

As always, advice graciously accepted! Thanks in advance!

lrhb :hat: