正如@RIAstar 指出的那样,它们是“关联数组”的属性——你的动态对象{}
:
var poets:Array = new Array();
poets.push({"name":"test","born":"1928"});
poets.push({name:"Angelou", born:"1928"});
poets.push({name:"Blake", born:"1757"});
poets.push({name:"cummings", born:"1894"});
poets.push({name:"Dante", born:"1265"});
poets.push({name:"Wang", born:"701"});
trace(poets[0].name,poets[0].born);
或者如果是更扩展的版本:
var prop1:String = "name";
var prop2:String = "born";
var poets:Array = [];
poets[0] = {};
poets[0][prop1] = "test2";
poets[0][prop2] = "1900";
trace(poets[0].name,poets[0].born);