Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created November 5, 2010 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelrinaldi/665008 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/665008 to your computer and use it in GitHub Desktop.
Just check if an object is a Vector instance or not.
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