You are searching for the is-operator:

var displayObject:DisplayObject = new Sprite();
trace(displayObject is DisplayObject);
trace(displayObject is Sprite);
trace(displayObject is UIComponent);

Best regards

--- In [email protected], Mark Carter <[EMAIL PROTECTED]> wrote:
>
> 
> I've got an array of objects which I want to filter according to the object's
> class. The class itself is referenced by a variable so I cannot use the "is"
> operator.
> 
> I'd like to be able to do something like:
> 
> filterClass.isInstance(obj)
> 
> Do I need to use isPrototypeOf()? - I don't really understand what that
> means.
> -- 
> View this message in context: http://www.nabble.com/Equivalent-to-Java%27s-
Class.isInstance%28Object%29-instance-method--tp20171501p20171501.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>



Reply via email to