So im having some issues with inheritance and its driving me crazy. Heres the situation.
I have a class, and a few movieclips in my library have this class set as their base class in the linkage settings. It refers to some manually added element in its constructor like so:
public class GenericBaseClass extends MovieClip{
public function GenericBaseClass(){
this.clip1.x = 50;
}
}
As long as all of the movie clips that use this as a base class have an element in their first frame called clip1, everything works fine.
Now say I want to extend GenericBaseClass to add more functionality like this:
public class SpecificClass extends GenericBaseClass {
public function SpecificClass(){
this.clip1.y = 100;
super();
}
}
I get a 1119 error that clip1 is possibly undefined. basically the constructor from GenericBaseClass can no longer find clip1.
So my question is: How can I write a class that will access some elements manually added to the stage and then subclass it to add more functionality?
any help is much appreciated, its been driving me nuts…