add attribute to a XML node at a specific position in AS3

ghezzo

New Member
I have this XML : \[code\]var myNode:XML = <node attribute="123"/>\[/code\]I know how to add an attribute to the node :\[code\]myNode.@otherAttribute = "abc";\[/code\]But this adds the attribute to the end. What if I want to add it as the first attribute ?I would like to have :\[code\]<node otherAttribute="abc" attribute="123"/>\[/code\]I know it is possible to add a child node to a specific position with \[code\]insertChildAfter()\[/code\] or \[code\]insertChildBefore()\[/code\] but I don't know of it's possible for an attribute.
 
Back
Top