In ActionScript all constructors must be public. Sometimes however, it is not feasible to allow a user to create a new instance of a class (since the class might be tied to physical system resources,network sockets, etc).
Does anyony know if there is a way to make a class non-creatable in ActionScript? In essence, what I'm aiming for is:
public class SomeClass
{
internal function SomeClass():void { }
. . .
}
I suppose I could get around this by defining an interface and implementing it in an internal class, but that just doesn't feel right to me:
internal class ClassImpl implements ISomeClass
{
. . .
}
Suggestions?