Adding to the insight, if you wanted to use the 'is' operator with those two
arguments, you need to create an instance of the Class and then use the 'is'
operator.
This would let you know if it is an instance of the object passed.
public static function
isObjectInstanceOfClass(obj:Object, cls:Class):Boolean
{
return obj is new cls();
}
We have asked the player engineers about the performance hit on this is not
as bad as describeType in some instances.
Mike
On Mon, Oct 27, 2008 at 9:55 AM, Amy <[EMAIL PROTECTED]> wrote:
> --- In [email protected] <flexcoders%40yahoogroups.com>, Mark
> Carter <[EMAIL PROTECTED]> wrote:
> >
> >
> > I don't think that works when I have a variable of Class type.
> >
> > public static function isObjectInstanceOfClass(obj:Object,
> > cls:Class):Boolean {
> > return obj is cls; // compile error
> > }
>
> By definition, a variable of type Class is not an instance of
> anything. Typically this is handled in the Framework code by casting
> whatever variable ought to be a Class to Class type.
>
> HTH;
>
> Amy
>
>
>
--
Teoti Graphix, LLC
http://www.teotigraphix.com
Teoti Graphix Blog
http://www.blog.teotigraphix.com
You can find more by solving the problem then by 'asking the question'.