The following example implement the Singleton In AS3 at the run-time.I don’t know if there is some other way to implement the Singleton in Compile-time.
With As 3.0 conforming to ECMA there you can no longer have private constructors which makes creating strict singletons a little bit more tricky. If I write a singleton, I want it written in a way that only a single instance can be created and if someone makes a mistake and tries to create an instance without using getInstance() an error will be thrown. This is a little workaround me and Rich came up with.
<br /><br />Implement the Singleton In AS3<br />The following example implement the Singleton In AS3 at the run-time.I don’t know if there is some other way to implement the Singleton in Compile-time.<br /> <br />From http://www.tink.ws/blog/stricter-singl