Posted By


wintondeshong on 08/26/07

Statistics


Viewed 635 times
Favorited by 0 user(s)

filterXMLAssocArray


/ Published in: ActionScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Filters specified tags from a supplied XML Node resource by tag name.
  2. // Returns a new associative array with the filtered tags' attributes.
  3. private function filterXMLAssocArray(filterNodeName:String, xmlNodes:Array):Array{
  4.  
  5. var tmpArray:Array = new Array();
  6.  
  7. var indexCounter:Number = 0;
  8. for (var i:Number = 0; i<xmlNodes.length; i++){
  9. if (xmlNodes[i].nodeName == filterNodeName){
  10. tmpArray[indexCounter] = new Array();
  11. tmpArray[indexCounter] = xmlNodes[i].attributes;
  12. indexCounter ++;
  13. }
  14. }
  15. return tmpArray;
  16. };

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.