Given an Object:
myObj = {key : 'value'}
How do I get the key?
Given an Object:
myObj = {key : 'value'}
How do I get the key?
You have to loop through the all the keys
for (var key:String in myObj) {
//...
}
Use a for in
loop
var myObject:Object = {key1:"value1",key2:"value2"}
for (var s:String in myObject){
trace("key:",s,"value:",myObject[s]);
}
output:
key: key1 value: value1
key: key2 value: value2