Tag Archives: actionscript

Actionscript: Determining if a Class object is a superclass or superinterface of another Class

Anyone who uses actionscript reflection in non-trivial cases will eventually run into this problem: The is operator only works on instances. For example:

This behavior is expected, but not very useful. Since cls is actually an instance of the Class class, we are actually checking whether the Class class inherits from each of those 5 things. Since Class only extends Object, that’s the only one that’s true.

What happens if you only have a Class object and you need to check if it’s the subclass of another Class?

Continue reading