home *** CD-ROM | disk | FTP | other *** search
- package controller
- {
- import flash.events.EventDispatcher;
-
- public class TraceController extends EventDispatcher
- {
- private static var allowInstantiation:Boolean;
-
- private static var instance:TraceController = null;
-
- public function TraceController()
- {
- super();
- if(!allowInstantiation)
- {
- throw new Error("Error: Instantiation failed: Use TraceController.getInstance() instead of new.");
- }
- }
-
- public static function getInstance() : TraceController
- {
- if(instance == null)
- {
- allowInstantiation = true;
- instance = new TraceController();
- allowInstantiation = false;
- }
- return instance;
- }
-
- public function tracef(param1:String) : void
- {
- trace(param1);
- }
- }
- }
-
-