ActionScript: Determine wether superclass implements a particular interface?
- by David Wolever
Is there any non-hacky way to determine wether a class' superclass implements a particular interface?
For example, assume I've got:
class A extends EventDispatcher implements StuffHolder {
private var myStuff = someKindOfStuff;
public function getStuff():Array {
if (super is StuffHolder) // <<< this doesn't work
return super['getStuff']().concat([myStuf]);
return [myStuff];
}
class B extends A {
private var myStuff = anotherKindOfStuff;
}
How could I perform that super is StuffHolder test in a way that, well, works? In this case, it always returns true.