views:

299

answers:

1

I've tried many different ways of accessing the name of an attribute, but just can't get it working.

The current Function:

protected function applyProperties(_axml:XML):void {

var list:XMLList = _axml.properties;

var list2:XMLList = list.attributes();

 for( var i = 0; i < list2.length(); i++ ){
         trace(list2[i].nodeName.toString());
 }

}

The XML it's referring to:

<content type="media">
<target>warning.png</target>
<properties x="20" mouseEnabled="$false"></properties>
</content>

I have tried the name, I've tried searching it as an Object, I looked for solutions on stackoverflow.. nothing has worked for me so far. Originally I had the properties node as such: fearing that Flash was interpretting incorrectly.

edit: It seems like the XML was interpretted rather than printed out..

A: 

list2[i] would be an XML object.

XML objects do not have nodeName, thats a XMLNode object.

try

list2[i].name().toString();
WORMSS