08-07-2008

ActionScript Array search function

Gosh it's simple.

returns true if the needle variable is found in the haystack array.

Otherwise  returns false.

function arraySearch(needle, haystack){
	for (var x in haystack){
		if (haystack[x]==needle) return true; 
	}
	return false; 
}

Comments:

Your comment:

»

 

[x]