In ActionScript 3, class constructors can only be set to public. Adobe has stated that this is because the ECMAScript specification is not yet complete, and they did not want to break forwards compatibility with the specification. This makes a lot of sense, but it leaves AS3 developers without a clear way to implement the Singleton design pattern. Luckily, there are a couple ways of faking Singleton functionality. Both solutions are kind of hack-ish, but they get the job done.

My first idea was to use errors to control instantiation:

// Singleton class:
package {
   
   public class SingletonDemo {
      private static var instance:SingletonDemo;
      private static var allowInstantiation:Boolean;
      
      public static function getInstance():SingletonDemo {
         if (instance == null) {
            allowInstantiation = true;
            instance = new SingletonDemo();
            allowInstantiation = false;
          }
         return instance;
       }
      
      public function SingletonDemo():void {
         if (!allowInstantiation) {
            throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
          }
       }
    }
}
This approach works very well and the implementation seems relatively clean to me. It will throw a run-time error if you try to instantiate the class directly, and will return null if you use try/catch to circumvent the error. The main disadvantage is that it does not generate compile time errors.

Claus Wahlers pointed me to another approach that was documented on the Kiwi Project blog. This approach takes advantage of the fact that you can define private classes outside of the package declaration, and use them as a "key" to control instantiation.

package {
   
   public class SingletonDemo {
      private static var instance:SingletonDemo;
      
      public static function getInstance():SingletonDemo {
         if (instance == null) {
            instance = new SingletonDemo(new SingletonBlocker());
          }
         return instance;
       }
      
      public function SingletonDemo(p_key:SingletonBlocker):void {
         // this shouldn't be necessary unless they fake out the compiler:
         if (p_key == null) {
            throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
          }
       }
    }
}
// the following code is also in the SingletonDemo.as file
// this class is only available to SingletonDemo
// (despite the internal access designation)
internal class SingletonBlocker {}
This second solution feels a little more hackish to me, and I'm not completely certain whether this private class feature is officially supported. However, if you need compile-time errors, it's the way to go.

Both solutions also break down if you try to extend the class, as the constructor will be called when the subclass is instantiated. Extending Singletons is fairly rare, but if you need to do it, I'd recommend modifying the first solution (the second solution simply won't work for inheritance).