views:

27

answers:

1

Hi,

A couple of days ago I asked 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: http://stackoverflow.com/questions/2856459/advanced-replace-in-c

Thanks

+1  A: 
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);
Patrick
thanks, worked great :)
Andreas