Skip to content

Instantly share code, notes, and snippets.

@mbolt35
Created November 1, 2012 02:28
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 mbolt35/3991256 to your computer and use it in GitHub Desktop.
Save mbolt35/3991256 to your computer and use it in GitHub Desktop.
// This constant is set to the fully qualified class name for Vector
private static const VECTOR_CLASS:String = "__AS3__.vec::Vector";
// Use flash.utils.describeType() on the input, and verify type
// of the object is a Vector class. This is probably fairly
// expensive, a valid point to my argument.
public static function isVector(vector:*):Boolean {
var type:String = flash.utils.describeType(vector).@name;
return type.indexOf(VECTOR_CLASS) != -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment