That is not a dynamic variable, it is a dynamic expression. Dynamic variables are pretty easy using bracket notation to resolve the reference, but evaluating expressions is much harder. I believe someone has done an expression parser.
Also, don't use lastResult in an AS expression unless it is a binding. Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jason B Sent: Thursday, August 14, 2008 2:39 PM To: [email protected] Subject: [flexcoders] using dynamic variables in flex? I want to have a dynamic variable in actionscript //skey is a label which should contain the xml node VALUE skey.text = 'reftables_additem_load_dataprovider.lastResult.DATARESULTS.VER_DATA.' + stringfunctions.toString(); Alert.show(skey.text); Currently it shows reftables_additem_load_dataprovider.lastResult.DATARESULTS.VER_DATA.VEHI CLE_SKEY which is correct behavior but now how do i use that text as a dynamic variable like? heres my current code var stringfunctions:String = new String(); var searchfor_skey:Number = new Number(); stringfunctions = columnData.field; //search for primary key searchfor_skey = stringfunctions.indexOf("SKEY", 0); if(searchfor_skey != -1){ //we got the skey column now store the value in the text box for http service later when saving ! skey.text = reftables_additem_load_dataprovider.lastResult.DATARESULTS.VER_DATA. + searchfor_skey.toString(); Alert.show(skey.text); //shows just string Alert.show(reftables_additem_load_dataprovider.lastResult.DATARESULTS.VE R_DATA.VEHICLE_SKEY); //WORKS showing value? }

