/ Published in: ActionScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Filters specified tags from a supplied XML Node resource by tag name. // Returns a new associative array with the filtered tags' attributes. private function filterXMLAssocArray(filterNodeName:String, xmlNodes:Array):Array{ var tmpArray:Array = new Array(); var indexCounter:Number = 0; for (var i:Number = 0; i<xmlNodes.length; i++){ if (xmlNodes[i].nodeName == filterNodeName){ tmpArray[indexCounter] = new Array(); tmpArray[indexCounter] = xmlNodes[i].attributes; indexCounter ++; } } return tmpArray; };