开发者

XML Node replacement in Actionscript 3

A couple of days ago I ask开发者_JAVA百科ed a question about how to replace and edit values in an xml file with c#. The question got a great answer. Now I wonder how to do this in Actionscript and if there is an as simple way as in c#.

The question can be found here: Advanced replace in C#

Thanks


var xml:XML=<items>                       
  <item x="15" y="25">                          
    <item y="10" x="30"></item>                 
  </item>                                       
  <item x="5" y="60"></item>                    
  <item y="100" x="10"></item>                  
</items>;                                       

for each (var item:XML in xml..item){
  item.@x=Number(item.@x)+Number(item.@y);
}

trace(xml);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜