Now, since on many occasions the MovieClip class is too general for our purposes, we define a SuperNode class, which extends MC, and servers as the parent for both M
egaNode and SimpleNode. We need to be able to manipulate the mainShape instance, so we instantiate it in the SuperNode class:
public var mainShape:MovieClip;
if we simply do that, the compiler will throw the following error: "1152: A conflict exists with inherited definition SuperNode.mainShape in namespace public."
The reason for that is that by default, all instances of linked MovieClips, such as mainShape, are automatically declared by default at runtime. In order to make sure that we don't get into that error again, we need to go to the ActionScript s
ettings, and uncheck the "Automatically declare stage instances" checkbox. With that done, the above mentioned code will work, and we'll be able to manipulate the mainShape instance from the SuperNode class
NOTE: Make sure that instances like mainShape are always declared as public