Flippie124
02-01-2005, 08:56 AM
I'd like to add properties to an object but the property names are defined in another variable.
in this piece of code I added "someproperty" to the object t:
var t:Object = new Object();
t.someproperty = "aap"
trace(t.someproperty);
what I want to do is this:
var propertyname = "someproperty";
var t:Object = new Object();
t.(propertyname) = "aap" // of course this doesn't work :(
trace(t.someproperty);
So the name of the property is extracted from the value of another variable.
in this piece of code I added "someproperty" to the object t:
var t:Object = new Object();
t.someproperty = "aap"
trace(t.someproperty);
what I want to do is this:
var propertyname = "someproperty";
var t:Object = new Object();
t.(propertyname) = "aap" // of course this doesn't work :(
trace(t.someproperty);
So the name of the property is extracted from the value of another variable.