Return to Snippet

Revision: 3636
at August 30, 2007 13:49 by wintondeshong


Updated Code
// 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;
	};

Revision: 3635
at August 30, 2007 13:48 by wintondeshong


Updated Code
// 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;
	};

Revision: 3634
at August 26, 2007 09:59 by wintondeshong


Initial Code
	// 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();
		
		for (var i:Number = 0; i<xmlNodes.length; i++){			
			if (xmlNodes[i].nodeName == filterNodeName){
				tmpArray[i] = new Array();
				tmpArray[i] = xmlNodes[i].attributes;
			}
		}
		return tmpArray;
	};

Initial URL


Initial Description


Initial Title
filterXMLAssocArray

Initial Tags
textmate, actionscript, array, xml, filter

Initial Language
ActionScript