//例六:添加或者修改属性
var userInfo:XML =
<xmlRoot>
<userItem id="1">
<user>userName1</user>
<age>1</age>
</userItem>
<userItem id="2">
<user>userName2</user>
<age>2</age>
</userItem>
<userItem id="3">
<user>userName3</user>
<age>3</age>
</userItem>
</xmlRoot>;
//修改:直接重新赋值就是了;添加:直接添加节点名并赋值就是了
userInfo.userItem.(@id=="3").age="changed";
userInfo.userItem.(@id=="3").addQQ="184845406";
trace(userInfo.userItem.(@id=="3"));
压缩包下载