I’m trying access a static variable located of a super class through an instance of one of it’s subclasses and I’m receiving an access of undefined property error (example of which below). Creating another static variable in the subclass and assigning the value from the super class will allow me to dot operate to it. I was wondering if anyone knew of a better way to do this, thanks.
Doc Class
public class TestingDocClass extends Sprite
{
public function TestingDocClass()
{
//trace(Fruit.COLOR); //returns red
// This returns 1119: Access of undefined property error
trace(Apple.COLOR);
}
}
Sub-class
public class Apple extends Fruit
{
public static const IS_DELICIOUS:Boolean = true;
//public static const APPLE_COLOR:String = Fruit.COLOR;
}
Super-class
public class Fruit
{
public static const COLOR:String = "red";
}