home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / controller / TraceController.as < prev    next >
Encoding:
Text File  |  2010-11-30  |  921 b   |  38 lines

  1. package controller
  2. {
  3.    import flash.events.EventDispatcher;
  4.    
  5.    public class TraceController extends EventDispatcher
  6.    {
  7.       private static var allowInstantiation:Boolean;
  8.       
  9.       private static var instance:TraceController = null;
  10.       
  11.       public function TraceController()
  12.       {
  13.          super();
  14.          if(!allowInstantiation)
  15.          {
  16.             throw new Error("Error: Instantiation failed: Use TraceController.getInstance() instead of new.");
  17.          }
  18.       }
  19.       
  20.       public static function getInstance() : TraceController
  21.       {
  22.          if(instance == null)
  23.          {
  24.             allowInstantiation = true;
  25.             instance = new TraceController();
  26.             allowInstantiation = false;
  27.          }
  28.          return instance;
  29.       }
  30.       
  31.       public function tracef(param1:String) : void
  32.       {
  33.          trace(param1);
  34.       }
  35.    }
  36. }
  37.  
  38.