Okay, actually it extends DisplayObjectContainer, but anyway…
I want to be able to use this class in several different applications, even applying it to library items. It also overrides several of DisplayObject’s methods, which is very important.
Basically, it works (or will work) just fine extending DisplayObjectContainer, but how do I allow other classes that extend DisplayObjectContainer to use the features of my new class. For instance, here is how the class looks now:
public class DockContainer extends DisplayObjectContainer
{ ... }
Let’s say I want the class to include the graphics class, so I make it into a Sprite, or perhaps I want to tie it to a library item, so it needs to be a MovieClip. The only method I can think of is creating a new DockContainer class for each item I want to be able to use:
public class DockContainer_Sprite extends Sprite
{ ... }
public class DockContainer_MovieClip extends MovieClip
{ ... }
The problem is if you want to be able to pass in a “DockContainer” as a parameter in a function, you would need to check if it is any of the 3 different types of DockContainers listed above.
Since DockContainer overrides several DisplayObject properties, it can’t be an instance tied to an IDockContainer interface that people can use inside of their classes.
How would I do this?