Please Help me .. string convert to field

Advertisement
Can anyone Pleassssse help ...
I am trying to save a field name info a variable such as:
var a:String = "city";
var rec_array:Array = new Array();
rec_array.push({name: "john", city: "omaha", zip: 68144});
rec_array.push({name: "john", city: "kansas city", zip:
72345});
for(i=0; i<rec_array.length; i++){
trace(rec_array
.name + ", " + rec_array.a);
and I get undefined since I am using a instead of city.
Can anyone help me ?
Thank you for all the help,
Sean.
Advertisement

Replay

and onemore thing. U have to post it in the Flash
ActionScript Forum.