home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 January / ME_2012_01.iso / Galileo-Video / system / ChromeLinux.swf / scripts / controller / VersionController.as
Encoding:
Text File  |  2010-11-16  |  1.2 KB  |  50 lines

  1. package controller
  2. {
  3.    import flash.events.EventDispatcher;
  4.    
  5.    public class VersionController extends EventDispatcher
  6.    {
  7.       private static var allowInstantiation:Boolean;
  8.       
  9.       private static var instance:VersionController = null;
  10.       
  11.       private static var _version:String = "";
  12.       
  13.       public function VersionController()
  14.       {
  15.          super();
  16.          if(!allowInstantiation)
  17.          {
  18.             throw new Error("Error: Instantiation failed: Use VersionController.getInstance() instead of new.");
  19.          }
  20.       }
  21.       
  22.       public static function getInstance(param1:String) : VersionController
  23.       {
  24.          if(instance == null)
  25.          {
  26.             _version = param1;
  27.             allowInstantiation = true;
  28.             instance = new VersionController();
  29.             allowInstantiation = false;
  30.          }
  31.          return instance;
  32.       }
  33.       
  34.       public function get version() : String
  35.       {
  36.          return _version;
  37.       }
  38.       
  39.       public function get path() : String
  40.       {
  41.          if(_version == "linux")
  42.          {
  43.             return "../";
  44.          }
  45.          return "";
  46.       }
  47.    }
  48. }
  49.  
  50.