AS3 - Can I know if a class implements an interface (or is a subclass of another class) ?

Posted by lk on Stack Overflow See other posts from Stack Overflow or by lk
Published on 2010-03-25T18:05:13Z Indexed on 2010/03/25 18:23 UTC
Read the original article Hit count: 118

Filed under:
|
|

With this code

function someFunction(classParam:Class):Boolean
{
    // how to know if classParam implements some interface?
}

i.e. Comparing classParam with IEventDispatcher interface:

someFunction(EventDispatcher) // returns true
someFunction(Object) // returns false

I know it can't be done with is operator. But, is there a way to do it? Is there a way to know if a class implements some interface? (or is a subclass of another class?)

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about class