<p>Since AS3 does not allow private constructors, it seems the only way to construct a singleton and guarantee the constructor isn't explicitly created via "new" is to pass a single parameter and check it.</p>

<p>I've heard two recommendations, one is to check the caller and ensure it's the static getInstance(), and the other is to have a private/internal class in the same package namespace.</p>

<p>The private object passed on the constructor seems preferable but it does not look like you can have a private class in the same package.  Is this true?  And more importantly is it the best way to implement a singleton?</p>

The pattern which is used by Cairngorm (which may not be the best) is to throw a runtime exception in the constructor if the constructor is being called a second time. For Example:
```
```
public class Foo {
  private static var instance : Foo;

  public Foo() {
    if( instance != null ) { 
      throw new Exception ("Singleton constructor called");
    }
    instance = this;
  }

  public static getInstance() : Foo {
    if( instance == null ) {
      instance = new Foo();
    }
    return instance;
  }

}
```
```