Then i might have misread/misunderstood ur problem. Perhaps this is something 
to work 
with:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application initialize="eventListener(event)" layout="absolute" 
xmlns:mx="http://www.adobe.com/2006/mxml";>
        <mx:Script>
                <![CDATA[
                        import flash.utils.describeType;
                        private function eventListener(event:Event):void
                        {
                                var classTypeXML:XML = 
describeType(flash.display.Sprite);
                                var instanceTypeXML:XML = describeType(new 
Sprite());  
                                trace([EMAIL PROTECTED], [EMAIL PROTECTED]);
                        }
                ]]>
        </mx:Script>
</mx:Application>

Best regards.

--- In [email protected], 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
> }
> 
> 
> florian.salihovic wrote:
> > 
> > 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 <code@> 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.
> >>
> > 
> > 
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Equivalent-to-Java%27s-
Class.isInstance%28Object%29-instance-method--tp20171501p20172786.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>



Reply via email to