2 Replies Latest reply on Dec 14, 2006 10:48 AM by cinemaguy

    Please Help me .. string convert to field

    Born2code Level 1
      Can anyone Pleassssse help ...

      I am trying to save a field name into 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,