Here’s a useful tip for Flash and Flex programmers. ActionScript 3.0 is great, but has no Singletons.
Samuel Agesilas has a solution that successfully prevents subclasses from calling the constructor using
super(), but it doesn’t prevent other code from creating new instances of a class with
Therefore I present to you a crafty hack to make a constructor truly private: add a required argument to the constructor, which must be set to a secret value that is only known to the class: