package org.as3lib.utils
{
import flash.utils.*;
/**
* Checks the class of instance
against the compareClass
for strict
* equality. If the classes are exactly the same, returns true. If
* the classes are different even if the instance
's class is a subclass
* of compareClass
, it returns false.
* Does not work with interfaces. The compareClass must be a class.
*
* @author Mims Wright
*
* @example
* var myBase:BaseClass = new BaseClass();
* var mySub:SubClass = new SubClass();
* trace(lib_flex_animation_code_10_org_as3lib_utils_strictIs(myBase, BaseClass)); // true
* trace(lib_flex_animation_code_10_org_as3lib_utils_strictIs(mySub, SubClass)); // true
* trace(lib_flex_animation_code_10_org_as3lib_utils_strictIs(mySub, BaseClass)); // false
*
*
* @param instance - the object whos class you want to check.
* @param compareClass - the class to compare your object against.
* @return true if instance is strictly of type compareClass.
*/
public function lib_flex_animation_code_10_org_as3lib_utils_strictIs(instance:Object, compareClass:Class):Boolean {
var instanceClass:Class = Class(getDefinitionByName(getQualifiedClassName(instance)));
return instanceClass == compareClass;
}
}