FLEX XML 动态添加属性

var tempXMl:XML = <object point="55" date="2010-4-6"/>;
tempXMl.@abc = 456;
trace(tempXMl.toXMLString());

输出

<object point="55" date="2010-4-6" abc="456"/>

动态

				var temp:XMLNodeType
				var tempXMl:XML = <object point="55" date="2010-4-6"/>;
				var tempStr:String = "sdsdsd";
				tempXMl.@[tempStr] = "sdsdksklfjgdlkfgdf"
				trace(tempXMl.toXMLString());

输出

<object point="55" date="2010-4-6" sdsdsd="sdsdksklfjgdlkfgdf"/>

posted @ 2011-03-09 11:37  春哥也编程  阅读(2264)  评论(0编辑  收藏  举报