The Ancestor class does, indeed, have a function called (for the sake of example) “foo”.
public static function callAncestorStaticMethod() : void
{
var ancestorClassName : String = getQualifiedSuperclassName(Descendant);
var ancestorClass : Class = Class(getDefinitionByName(ancestorClassName));
ancestorClass.foo(); // <---- runtime error here: foo is not a function
}
Examining ancestorClass finds it an Object with no visible properties (ancestorClass.prototype does not either).
So, how do I call a static function on a class when I only have its name as a string at runtime ?
I was able to call a static function in the superclass using the following code:
A Class object has all of the static properties and methods of the Class, so this should be reliable.
cl.fooreturns a Function object that you can then.call().