package ch15_1
{
import flash.display.MovieClip;
public class XMLText2 extends MovieClip
{
public function XMLText2()
{
var xml:XML =
<book title ="Learning ActionScript 3.0" price ="$100">
<author>Derry Mathew</author>
<pages>552</pages>
</book>
trace(xml.@price);
var xml2:XML = new XML(<author/>);
xml2.name="hridream";
xml2.age =35;
xml2.gender ="male";
xml2.title ="GM";
xml2.@price="100$";//xml2的属性
trace(xml.title);
trace(xml2.name);
trace(xml2.@price);
}
}
}
AS3.0实现创建XMl
最新推荐文章于 2019-05-10 09:05:52 发布