am77.de

Grafik Design, Interaktive Gestaltung, Spiele, Motion Graphics

AS3 xml node by attribute

leave a comment

So erhält man in AS3 eine XMLList aller XML nodes, deren Atribut einem bestimmten Wert entspricht:


var xml:XML = <Root>
<Names>
<Name type="M" value="John Doe" />
<Name type="F" value="Jane Doe" />
<Name type="M" value="John Hancock" />
</Names>
<Other />
</Root>

var xnList:XMLList = xml.Names.Name.(@type == “M”);

 

Written by am

March 2nd, 2013 at 9:40 am