Skip to content

Instantly share code, notes, and snippets.

@millermedeiros
Forked from rafaelrinaldi/isVector.as
Created November 6, 2010 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save millermedeiros/665067 to your computer and use it in GitHub Desktop.
Save millermedeiros/665067 to your computer and use it in GitHub Desktop.
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).indexOf("__AS3__.vec::Vector") > -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment