Archive for January, 2008

Event Bubbling AS3
Thursday, January 17th, 2008

Getting used to new features (and discovering them) in AS3 will take some time. My friends over at 8BitRocket realize this just as much as I do.
Something I heard about over and over again was event bubbling. I knew what it did; I knew it would be a good thing to use in […]

Singleton Enforcer AS3
Thursday, January 17th, 2008

Just a helpful way to do Singleton’s in AS3 since there is no longer private constructors:
package
{
   public class SingletonClass
   {
      private static var INSTANCE : SingletonClass
      public function SingletonClass(enforcer:SingletonEnforcer)
      { // construction }
      public static function getInstance(): SingletonClass
      {
         if(INSTANCE == null)
         {
            INSTANCE = new SingletonClass(new SingletonEnforcer());
         }
         return INSTANCE;
      }
   }
}
class SingletonEnforcer{}