/ Published in: ActionScript 3
Expand |
Embed | Plain Text
public function Singleton(caller:Function = null):void { if ( caller == hidden ) { _instance = this; } else { throw new Error( "Please use the instance property to access." ); } } public static function get instance():Singleton { if (!_instance) { new Singleton(hidden); } return _instance; } private static function hidden():void { }
You need to login to post a comment.
