I have a class SuperClass that implements an interface, and has all the public methods of the interface implemented. I have another class SubClass that extends SuperClass. I dont want those public methods being used incorrectly. This leads to my question:
How do I prevent SuperClass from ever being instantiated as an object?
Brian
Update: Using hint from answer below, solution is:
public function MyClass():void
{
if(getQualifiedClassName(this) == "ui.controls::MyClass")
{
throw new Error('MyClass is an abstract class, do ' +
'not instantiate');
}
}
AS3 does not support abstract classes. The best you can do is runtime enforcement. Check out this post for more info.