Posts Tagged ‘singleton’

How to implement singleton pattern in actionscript 3

In actionscript 3 one can not use private scope for constructor and you need a workaround to implement simgleton pattern. Following is one way that I use package { public class Singleton { private static var instance:Singleton; private static var isAllowedInstance:Boolean;   public function Singleton() { if (!isAllowedInstance) { throw new Error("Please use " + [...]