Skip to content

Instantly share code, notes, and snippets.

@Nutrox
Created May 2, 2011 22:06
Show Gist options
  • Save Nutrox/952470 to your computer and use it in GitHub Desktop.
Save Nutrox/952470 to your computer and use it in GitHub Desktop.
Easy Singleton Example
package
{
public class Singleton
{
static public const instance:Singleton = new Singleton();
public function Singleton()
{
if( instance )
{
throw new Error("Singleton class cannot be instantiated");
}
}
}// EOC
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment