/ Published in: ActionScript 3
URL: http://life.neophi.com/danielr/2006/10/singleton_pattern_in_as3.html
Expand |
Embed | Plain Text
package { public final class Singleton { private static var instance:Singleton = new Singleton(); public function Singleton() { if( instance ) throw new Error( "Singleton and can only be accessed through Singleton.getInstance()" ); } public static function getInstance():Singleton { return instance; } } }
You need to login to post a comment.
