Created
November 5, 2010 22:54
-
-
Save rafaelrinaldi/665008 to your computer and use it in GitHub Desktop.
Just check if an object is a Vector instance or not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rinaldi.util { | |
import flash.utils.getQualifiedClassName; | |
/** | |
* | |
* Just check if an object is a Vector instance or not. | |
* | |
* @param p_object Object to be checked. | |
* @return Returns "true" if it's a vector instance, "false" otherwise. | |
* | |
* @example | |
* <pre> | |
* import rinaldi.util.isVector; | |
* | |
* trace(isVector(new Vector.<*>)); // true | |
* trace(isVector(new Array)); // false | |
* </pre> | |
* | |
* @author Rafael Rinaldi (rafaelrinaldi.com) | |
* | |
*/ | |
public function isVector( p_object : Object ) : Boolean { | |
return getQualifiedClassName(p_object).split("__AS3__.vec::Vector").length > 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment