home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / mx / core / FlexVersion.as < prev    next >
Encoding:
Text File  |  2010-06-23  |  3.6 KB  |  109 lines

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