/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * _isInArray * Checks to see if a supplied element is in an array. * the indexOf function returns -1 if it doesn't find the * element in array, so we check if indexOf returns 0 or greater. * * @param element * (any object) The element we are checking for * @param array Array The array to see if element is in * @return Boolean True if element is found in array, False if not * @access private */ private function _isInArray(element:*, array:Array):Boolean { return (array.indexOf(element) >= 0); }