So, how would you create a class that can access a variable in the class where the subClass was created(superclass), I realise this might be unclear so in example
package {
import flash.display.MovieClip;
public class Main extends MovieClip {
public var demoString:String = "TEST";
public static var newClass:SubClass;
public function Main() {
// constructor code
init();
}
public function init():void{
newClass = new SubClass();
}
}
}
package {
public class SubClass extends Main{
public function SubClass() {
// constructor code
trace(super(demoString));
}
}
}
I cant read demoString from the SuperClass and when I try and test this code I get this error?
Error: Error #2136: The SWF file file:///C|/Users/classes/Main.swf contains invalid data.
at Main/init()
at Main()