flash - Variable Object Property Names in As3 flex? -


i need create variable object property names use data grid component.

this works:

 data = new object();  data.some_name = "the data"; 

but not:

 data = new object();  colname = "some_name";  data[colname] = "the data"; 

can me? can object property names variable?

var colname:string = "column title"; var colnamenospace:string = "columntitle"  var dataobject:object = new object(); dataobject[colname] = "what's problem?"; dataobject[colnamenospace] = "there's no problem!"  trace(dataobject["column title"]);  //what's problem? trace(dataobject[colname]);         //what's problem? trace(dataobject.columntitle);      //there's no problem! trace(dataobject[colnamenospace]);  //there's no problem! 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -