AS3操作XML [一]: 声明XML变量并读取其节点内容

      Flash 2007-6-14 8:20

// 例1:声明XML变量并读取其节点内容

// AS3 里面初始化 xml 可以很爽地使用 xml 格式了, 也就想 Tab 就 Tab , 想换行就换行
var userInfo:XML =
<xmlRoot>

<userItem id="1">
<user>userName1</user>
<age>age1</age>
</userItem>

<userItem id="2">
<user>userName2</user>
<age>age2</age>
</userItem>

</xmlRoot>;

trace(userInfo.userItem[0].age); // 输出age1

  源文件: 压缩包下载




标签集:TAGS:AS3
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}