home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / gs / OverwriteManager.as next >
Encoding:
Text File  |  2009-05-06  |  4.1 KB  |  135 lines

  1. package gs
  2. {
  3.    import flash.errors.*;
  4.    import flash.utils.*;
  5.    
  6.    public class OverwriteManager
  7.    {
  8.       public static var mode:int;
  9.       
  10.       public static var enabled:Boolean;
  11.       
  12.       public static const version:Number = 0.96;
  13.       
  14.       public static const NONE:int = 0;
  15.       
  16.       public static const ALL:int = 1;
  17.       
  18.       public static const AUTO:int = 2;
  19.       
  20.       public static const CONCURRENT:int = 3;
  21.       
  22.       public function OverwriteManager()
  23.       {
  24.          super();
  25.       }
  26.       
  27.       public static function killVars(param1:Object, param2:Object, param3:Array, param4:Array, param5:Array) : void
  28.       {
  29.          var _loc7_:String = null;
  30.          var _loc6_:int = int(param4.length - 1);
  31.          while(_loc6_ > -1)
  32.          {
  33.             if(param1[param4[_loc6_].name] != undefined)
  34.             {
  35.                param4.splice(_loc6_,1);
  36.             }
  37.             _loc6_--;
  38.          }
  39.          _loc6_ = int(param3.length - 1);
  40.          while(_loc6_ > -1)
  41.          {
  42.             if(param1[param3[_loc6_].name] != undefined)
  43.             {
  44.                param3.splice(_loc6_,1);
  45.             }
  46.             _loc6_--;
  47.          }
  48.          _loc6_ = int(param5.length - 1);
  49.          while(_loc6_ > -1)
  50.          {
  51.             if(param1[param5[_loc6_].name] != undefined)
  52.             {
  53.                param5.splice(_loc6_,1);
  54.             }
  55.             _loc6_--;
  56.          }
  57.          for(_loc7_ in param1)
  58.          {
  59.             delete param2[_loc7_];
  60.          }
  61.       }
  62.       
  63.       public static function manageOverwrites(param1:TweenLite, param2:Dictionary) : void
  64.       {
  65.          var _loc5_:Object = null;
  66.          var _loc8_:int = 0;
  67.          var _loc9_:Object = null;
  68.          var _loc10_:String = null;
  69.          var _loc3_:Object = param1.vars;
  70.          var _loc4_:int = _loc3_.overwrite == undefined ? mode : int(_loc3_.overwrite);
  71.          if(_loc4_ < 2)
  72.          {
  73.             return;
  74.          }
  75.          var _loc6_:Number = param1.startTime;
  76.          var _loc7_:Array = [];
  77.          for each(_loc5_ in param2)
  78.          {
  79.             if(_loc5_ != param1 && _loc5_.startTime <= _loc6_)
  80.             {
  81.                _loc7_[_loc7_.length] = _loc5_;
  82.             }
  83.          }
  84.          if(_loc7_.length == 0)
  85.          {
  86.             return;
  87.          }
  88.          if(_loc4_ == AUTO)
  89.          {
  90.             if(_loc3_.isTV == true)
  91.             {
  92.                _loc3_ = _loc3_.exposedProps;
  93.             }
  94.             _loc9_ = {};
  95.             for(_loc10_ in _loc3_)
  96.             {
  97.                if(!(_loc10_ == "ease" || _loc10_ == "delay" || _loc10_ == "overwrite" || _loc10_ == "onComplete" || _loc10_ == "onCompleteParams" || _loc10_ == "runBackwards" || _loc10_ == "persist" || _loc10_ == "onUpdate" || _loc10_ == "onUpdateParams" || _loc10_ == "timeScale" || _loc10_ == "onStart" || _loc10_ == "onStartParams" || _loc10_ == "renderOnStart" || _loc10_ == "proxiedEase" || _loc10_ == "easeParams" || _loc10_ == "onCompleteAll" || _loc10_ == "onCompleteAllParams" || _loc10_ == "yoyo" || _loc10_ == "loop"))
  98.                {
  99.                   _loc9_[_loc10_] = 1;
  100.                }
  101.             }
  102.             _loc8_ = int(_loc7_.length - 1);
  103.             while(_loc8_ > -1)
  104.             {
  105.                _loc7_[_loc8_].killVars(_loc9_);
  106.                _loc8_--;
  107.             }
  108.          }
  109.          else
  110.          {
  111.             _loc8_ = int(_loc7_.length - 1);
  112.             while(_loc8_ > -1)
  113.             {
  114.                param2[_loc7_[_loc8_]] = null;
  115.                delete param2[_loc7_[_loc8_]];
  116.                _loc8_--;
  117.             }
  118.          }
  119.       }
  120.       
  121.       public static function init(param1:int = 2) : int
  122.       {
  123.          if(TweenLite.version < 8.14)
  124.          {
  125.             trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
  126.          }
  127.          TweenLite.overwriteManager = OverwriteManager;
  128.          mode = param1;
  129.          enabled = true;
  130.          return mode;
  131.       }
  132.    }
  133. }
  134.  
  135.