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

  1. package controller
  2. {
  3.    import flash.events.Event;
  4.    import flash.events.EventDispatcher;
  5.    
  6.    public class LoadingController extends EventDispatcher
  7.    {
  8.       private static var allowInstantiation:Boolean;
  9.       
  10.       private static var _help:String;
  11.       
  12.       private static var _exercise:String;
  13.       
  14.       public static var PROGRESS:String = "progress";
  15.       
  16.       private static var _loaded:Number = 0;
  17.       
  18.       private static var _total:Number = 0;
  19.       
  20.       private static var instance:LoadingController = null;
  21.       
  22.       public function LoadingController()
  23.       {
  24.          super();
  25.          if(!allowInstantiation)
  26.          {
  27.             throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
  28.          }
  29.       }
  30.       
  31.       public static function getInstance() : LoadingController
  32.       {
  33.          if(instance == null)
  34.          {
  35.             allowInstantiation = true;
  36.             instance = new LoadingController();
  37.             allowInstantiation = false;
  38.          }
  39.          return instance;
  40.       }
  41.       
  42.       public function set loaded(param1:Number) : void
  43.       {
  44.          _loaded = param1;
  45.          dispatchEvent(new Event(PROGRESS));
  46.       }
  47.       
  48.       public function get loaded() : Number
  49.       {
  50.          return _loaded;
  51.       }
  52.       
  53.       public function set total(param1:Number) : void
  54.       {
  55.          _total = param1;
  56.       }
  57.       
  58.       public function get total() : Number
  59.       {
  60.          return _total;
  61.       }
  62.       
  63.       public function set exercise(param1:String) : void
  64.       {
  65.          _exercise = param1;
  66.       }
  67.       
  68.       public function get exercise() : String
  69.       {
  70.          return _exercise;
  71.       }
  72.       
  73.       public function set help(param1:String) : void
  74.       {
  75.          _help = param1;
  76.       }
  77.       
  78.       public function get help() : String
  79.       {
  80.          return _help;
  81.       }
  82.    }
  83. }
  84.  
  85.