AS3.0实现创建XMl

前端之家收集整理的这篇文章主要介绍了AS3.0实现创建XMl前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
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);
		}
	}
}
原文链接:https://www.f2er.com/xml/299985.html

猜你在找的XML相关文章