Revision: 13577
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 28, 2009 11:56 by allnatural
Initial Code
package { public class Example { private static var instance:Example; public function Example(access:Access){ if (access != null) { if (Example.instance == null){ Example.instance = this; } } else { throw new Error(â€Illegal operationâ€); } } //provides access to singleton instance public static function getInstance():Example{ if (instance == null){ instance = new Example(); } return Example; } } }
Initial URL
http://www.destroyyourcomputer.com
Initial Description
Easily create a SINGLE USE ONLY (Singleton) Class Object with this template.
Initial Title
Simple Singleton Template
Initial Tags
class, simple
Initial Language
ActionScript 3