AS3操作XML [八]: 访问comment

      Flash 2007-6-14 8:45

//例八:访问comment
XML.ignoreComments=false;////默认为true,不会显示comment的

var userInfo:XML =
<xmlRoot>

<!--这里是comment 1 (注释)-->
<!--这里是comment 2 (注释)-->

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

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

</xmlRoot>;
//访问第几条comment语法如下:
trace(userInfo.comments()[1].toXMLString());

 压缩包下载


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

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}