home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / HexiomConnect.swf / scripts / mx / core / FlexVersion.as < prev    next >
Encoding:
Text File  |  2008-08-29  |  3.6 KB  |  110 lines

  1. package mx.core
  2. {
  3.    import mx.resources.ResourceManager;
  4.    
  5.    use namespace mx_internal;
  6.    
  7.    public class FlexVersion
  8.    {
  9.       
  10.       private static var compatibilityVersionChanged:Boolean = false;
  11.       
  12.       public static const VERSION_2_0_1:uint = 33554433;
  13.       
  14.       private static var _compatibilityErrorFunction:Function;
  15.       
  16.       public static const CURRENT_VERSION:uint = 50331648;
  17.       
  18.       public static const VERSION_3_0:uint = 50331648;
  19.       
  20.       public static const VERSION_2_0:uint = 33554432;
  21.       
  22.       private static var _compatibilityVersion:uint = CURRENT_VERSION;
  23.       
  24.       public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
  25.       
  26.       public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
  27.       
  28.       mx_internal static const VERSION:String = "3.0.0.0";
  29.       
  30.       private static var compatibilityVersionRead:Boolean = false;
  31.        
  32.       
  33.       public function FlexVersion()
  34.       {
  35.          super();
  36.       }
  37.       
  38.       mx_internal static function changeCompatibilityVersionString(param1:String) : void
  39.       {
  40.          var _loc2_:Array = param1.split(".");
  41.          var _loc3_:uint = parseInt(_loc2_[0]);
  42.          var _loc4_:uint = parseInt(_loc2_[1]);
  43.          var _loc5_:uint = parseInt(_loc2_[2]);
  44.          _compatibilityVersion = (_loc3_ << 24) + (_loc4_ << 16) + _loc5_;
  45.       }
  46.       
  47.       public static function set compatibilityVersion(param1:uint) : void
  48.       {
  49.          var _loc2_:String = null;
  50.          if(param1 == _compatibilityVersion)
  51.          {
  52.             return;
  53.          }
  54.          if(compatibilityVersionChanged)
  55.          {
  56.             if(compatibilityErrorFunction == null)
  57.             {
  58.                _loc2_ = ResourceManager.getInstance().getString("core",VERSION_ALREADY_SET);
  59.                throw new Error(_loc2_);
  60.             }
  61.             compatibilityErrorFunction(param1,VERSION_ALREADY_SET);
  62.          }
  63.          if(compatibilityVersionRead)
  64.          {
  65.             if(compatibilityErrorFunction == null)
  66.             {
  67.                _loc2_ = ResourceManager.getInstance().getString("core",VERSION_ALREADY_READ);
  68.                throw new Error(_loc2_);
  69.             }
  70.             compatibilityErrorFunction(param1,VERSION_ALREADY_READ);
  71.          }
  72.          _compatibilityVersion = param1;
  73.          compatibilityVersionChanged = true;
  74.       }
  75.       
  76.       public static function get compatibilityVersion() : uint
  77.       {
  78.          compatibilityVersionRead = true;
  79.          return _compatibilityVersion;
  80.       }
  81.       
  82.       public static function set compatibilityErrorFunction(param1:Function) : void
  83.       {
  84.          _compatibilityErrorFunction = param1;
  85.       }
  86.       
  87.       public static function set compatibilityVersionString(param1:String) : void
  88.       {
  89.          var _loc2_:Array = param1.split(".");
  90.          var _loc3_:uint = parseInt(_loc2_[0]);
  91.          var _loc4_:uint = parseInt(_loc2_[1]);
  92.          var _loc5_:uint = parseInt(_loc2_[2]);
  93.          compatibilityVersion = (_loc3_ << 24) + (_loc4_ << 16) + _loc5_;
  94.       }
  95.       
  96.       public static function get compatibilityErrorFunction() : Function
  97.       {
  98.          return _compatibilityErrorFunction;
  99.       }
  100.       
  101.       public static function get compatibilityVersionString() : String
  102.       {
  103.          var _loc1_:uint = uint(compatibilityVersion >> 24 & 255);
  104.          var _loc2_:uint = uint(compatibilityVersion >> 16 & 255);
  105.          var _loc3_:uint = uint(compatibilityVersion & 65535);
  106.          return _loc1_.toString() + "." + _loc2_.toString() + "." + _loc3_.toString();
  107.       }
  108.    }
  109. }
  110.