var type:Array = ["type0", "type1", "type2"]; var property:Array = [["20","0","1.jpg"], ["60","0","2.jpg"], ["120","0","3.jpg"]];var data:XML = new XML("<data type=‘any‘></data>"); for (var i:int = 0; i < property.length; i++) { var node:XML = new XML(); node = <item type={type[i]}> <property x={property[i][0]} y={property[i][1]}></property> <path url={property[i][2]}></path> </item>; data = data.appendChild(node) } trace(data);
时间: 2024-10-09 14:02:08