home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / gs / TweenMax.as < prev   
Encoding:
Text File  |  2009-05-06  |  34.7 KB  |  1,091 lines

  1. package gs
  2. {
  3.    import flash.events.Event;
  4.    import flash.events.EventDispatcher;
  5.    import flash.events.IEventDispatcher;
  6.    import flash.utils.*;
  7.    import gs.events.TweenEvent;
  8.    
  9.    public class TweenMax extends TweenFilterLite implements IEventDispatcher
  10.    {
  11.       public static var version:Number = 2.34;
  12.       
  13.       protected static const _RAD2DEG:Number = 180 / Math.PI;
  14.       
  15.       private static var _overwriteMode:int = OverwriteManager.enabled ? OverwriteManager.mode : OverwriteManager.init();
  16.       
  17.       public static var killTweensOf:Function = TweenLite.killTweensOf;
  18.       
  19.       public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
  20.       
  21.       public static var removeTween:Function = TweenLite.removeTween;
  22.       
  23.       public static var setGlobalTimeScale:Function = TweenFilterLite.setGlobalTimeScale;
  24.       
  25.       protected var _dispatcher:EventDispatcher;
  26.       
  27.       protected var _callbacks:Object;
  28.       
  29.       protected var _pauseTime:int;
  30.       
  31.       public function TweenMax(param1:Object, param2:Number, param3:Object)
  32.       {
  33.          super(param1,param2,param3);
  34.          this._pauseTime = -1;
  35.          if(this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null)
  36.          {
  37.             this.initDispatcher();
  38.             if(param2 == 0 && this.delay == 0)
  39.             {
  40.                this.onUpdateDispatcher();
  41.                this.onCompleteDispatcher();
  42.             }
  43.          }
  44.          if(this.vars.yoyo == true || this.vars.loop == true)
  45.          {
  46.             this.vars.persist = true;
  47.          }
  48.          if(TweenFilterLite.version < 8.22)
  49.          {
  50.             trace("TweenMax error! Please update your TweenFilterLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
  51.          }
  52.       }
  53.       
  54.       public static function sequence(param1:Object, param2:Array) : Array
  55.       {
  56.          var _loc3_:uint = 0;
  57.          while(_loc3_ < param2.length)
  58.          {
  59.             param2[_loc3_].target = param1;
  60.             _loc3_++;
  61.          }
  62.          return multiSequence(param2);
  63.       }
  64.       
  65.       public static function bezierProxy(param1:Object) : void
  66.       {
  67.          var _loc5_:int = 0;
  68.          var _loc6_:String = null;
  69.          var _loc7_:Object = null;
  70.          var _loc8_:Number = NaN;
  71.          var _loc9_:uint = 0;
  72.          var _loc2_:Number = Number(param1.target.t);
  73.          var _loc3_:Object = param1.info.props;
  74.          var _loc4_:Object = param1.info.target;
  75.          if(_loc2_ == 1)
  76.          {
  77.             for(_loc6_ in _loc3_)
  78.             {
  79.                _loc5_ = _loc3_[_loc6_].length - 1;
  80.                _loc4_[_loc6_] = _loc3_[_loc6_][_loc5_].e;
  81.             }
  82.          }
  83.          else
  84.          {
  85.             for(_loc6_ in _loc3_)
  86.             {
  87.                _loc9_ = uint(_loc3_[_loc6_].length);
  88.                if(_loc2_ < 0)
  89.                {
  90.                   _loc5_ = 0;
  91.                }
  92.                else if(_loc2_ >= 1)
  93.                {
  94.                   _loc5_ = int(_loc9_ - 1);
  95.                }
  96.                else
  97.                {
  98.                   _loc5_ = int(_loc9_ * _loc2_);
  99.                }
  100.                _loc8_ = (_loc2_ - _loc5_ * (1 / _loc9_)) * _loc9_;
  101.                _loc7_ = _loc3_[_loc6_][_loc5_];
  102.                _loc4_[_loc6_] = _loc7_.s + _loc8_ * (2 * (1 - _loc8_) * (_loc7_.cp - _loc7_.s) + _loc8_ * (_loc7_.e - _loc7_.s));
  103.             }
  104.          }
  105.       }
  106.       
  107.       public static function hexColorsProxy(param1:Object) : void
  108.       {
  109.          param1.info.target[param1.info.prop] = uint(param1.target.r << 16 | param1.target.g << 8 | param1.target.b);
  110.       }
  111.       
  112.       public static function parseBeziers(param1:Object, param2:Boolean = false) : Object
  113.       {
  114.          var _loc3_:int = 0;
  115.          var _loc4_:Array = null;
  116.          var _loc5_:Object = null;
  117.          var _loc6_:String = null;
  118.          var _loc7_:Object = {};
  119.          if(param2)
  120.          {
  121.             for(_loc6_ in param1)
  122.             {
  123.                _loc4_ = param1[_loc6_];
  124.                _loc7_[_loc6_] = _loc5_ = [];
  125.                if(_loc4_.length > 2)
  126.                {
  127.                   _loc5_[_loc5_.length] = {
  128.                      "s":_loc4_[0],
  129.                      "cp":_loc4_[1] - (_loc4_[2] - _loc4_[0]) / 4,
  130.                      "e":_loc4_[1]
  131.                   };
  132.                   _loc3_ = 1;
  133.                   while(_loc3_ < _loc4_.length - 1)
  134.                   {
  135.                      _loc5_[_loc5_.length] = {
  136.                         "s":_loc4_[_loc3_],
  137.                         "cp":_loc4_[_loc3_] + (_loc4_[_loc3_] - _loc5_[_loc3_ - 1].cp),
  138.                         "e":_loc4_[_loc3_ + 1]
  139.                      };
  140.                      _loc3_++;
  141.                   }
  142.                }
  143.                else
  144.                {
  145.                   _loc5_[_loc5_.length] = {
  146.                      "s":_loc4_[0],
  147.                      "cp":(_loc4_[0] + _loc4_[1]) / 2,
  148.                      "e":_loc4_[1]
  149.                   };
  150.                }
  151.             }
  152.          }
  153.          else
  154.          {
  155.             for(_loc6_ in param1)
  156.             {
  157.                _loc4_ = param1[_loc6_];
  158.                _loc7_[_loc6_] = _loc5_ = [];
  159.                if(_loc4_.length > 3)
  160.                {
  161.                   _loc5_[_loc5_.length] = {
  162.                      "s":_loc4_[0],
  163.                      "cp":_loc4_[1],
  164.                      "e":(_loc4_[1] + _loc4_[2]) / 2
  165.                   };
  166.                   _loc3_ = 2;
  167.                   while(_loc3_ < _loc4_.length - 2)
  168.                   {
  169.                      _loc5_.push({
  170.                         "s":_loc5_[_loc3_ - 2].e,
  171.                         "cp":_loc4_[_loc3_],
  172.                         "e":(_loc4_[_loc3_] + _loc4_[_loc3_ + 1]) / 2
  173.                      });
  174.                      _loc3_++;
  175.                   }
  176.                   _loc5_[_loc5_.length] = {
  177.                      "s":_loc5_[_loc5_.length - 1].e,
  178.                      "cp":_loc4_[_loc4_.length - 2],
  179.                      "e":_loc4_[_loc4_.length - 1]
  180.                   };
  181.                }
  182.                else if(_loc4_.length == 3)
  183.                {
  184.                   _loc5_[_loc5_.length] = {
  185.                      "s":_loc4_[0],
  186.                      "cp":_loc4_[1],
  187.                      "e":_loc4_[2]
  188.                   };
  189.                }
  190.                else if(_loc4_.length == 2)
  191.                {
  192.                   _loc5_[_loc5_.length] = {
  193.                      "s":_loc4_[0],
  194.                      "cp":(_loc4_[0] + _loc4_[1]) / 2,
  195.                      "e":_loc4_[1]
  196.                   };
  197.                }
  198.             }
  199.          }
  200.          return _loc7_;
  201.       }
  202.       
  203.       public static function bezierProxy2(param1:Object) : void
  204.       {
  205.          var _loc5_:Number = NaN;
  206.          var _loc6_:Number = NaN;
  207.          var _loc7_:Number = NaN;
  208.          var _loc8_:Array = null;
  209.          var _loc9_:Number = NaN;
  210.          bezierProxy(param1);
  211.          var _loc2_:Object = {};
  212.          var _loc3_:Object = param1.info.target;
  213.          param1.info.target = _loc2_;
  214.          param1.target.t += 0.01;
  215.          bezierProxy(param1);
  216.          var _loc4_:Array = param1.info.orientToBezier;
  217.          var _loc10_:uint = 0;
  218.          while(_loc10_ < _loc4_.length)
  219.          {
  220.             _loc8_ = _loc4_[_loc10_];
  221.             _loc9_ = Number(Number(_loc8_[3]) || 0);
  222.             _loc6_ = _loc2_[_loc8_[0]] - _loc3_[_loc8_[0]];
  223.             _loc7_ = _loc2_[_loc8_[1]] - _loc3_[_loc8_[1]];
  224.             _loc3_[_loc8_[2]] = Math.atan2(_loc7_,_loc6_) * _RAD2DEG + _loc9_;
  225.             _loc10_++;
  226.          }
  227.          param1.info.target = _loc3_;
  228.          param1.target.t -= 0.01;
  229.       }
  230.       
  231.       public static function pauseAll(param1:Boolean = true, param2:Boolean = false) : void
  232.       {
  233.          changePause(true,param1,param2);
  234.       }
  235.       
  236.       public static function set globalTimeScale(param1:Number) : void
  237.       {
  238.          setGlobalTimeScale(param1);
  239.       }
  240.       
  241.       public static function get globalTimeScale() : Number
  242.       {
  243.          return _globalTimeScale;
  244.       }
  245.       
  246.       public static function getTweensOf(param1:Object) : Array
  247.       {
  248.          var _loc4_:Object = null;
  249.          var _loc2_:Dictionary = _all[param1];
  250.          var _loc3_:Array = [];
  251.          if(_loc2_ != null)
  252.          {
  253.             for(_loc4_ in _loc2_)
  254.             {
  255.                if(_loc2_[_loc4_].tweens != undefined)
  256.                {
  257.                   _loc3_[_loc3_.length] = _loc2_[_loc4_];
  258.                }
  259.             }
  260.          }
  261.          return _loc3_;
  262.       }
  263.       
  264.       public static function killAllDelayedCalls(param1:Boolean = false) : void
  265.       {
  266.          killAll(param1,false,true);
  267.       }
  268.       
  269.       public static function multiSequence(param1:Array) : Array
  270.       {
  271.          var _loc6_:Object = null;
  272.          var _loc7_:Object = null;
  273.          var _loc8_:Number = NaN;
  274.          var _loc9_:Number = NaN;
  275.          var _loc10_:uint = 0;
  276.          var _loc11_:Object = null;
  277.          var _loc12_:String = null;
  278.          var _loc2_:Dictionary = new Dictionary();
  279.          var _loc3_:Array = [];
  280.          var _loc4_:int = int(TweenLite.overwriteManager.mode);
  281.          var _loc5_:Number = 0;
  282.          _loc10_ = 0;
  283.          while(_loc10_ < param1.length)
  284.          {
  285.             _loc6_ = param1[_loc10_];
  286.             _loc9_ = Number(Number(_loc6_.time) || 0);
  287.             _loc11_ = {};
  288.             for(_loc12_ in _loc6_)
  289.             {
  290.                _loc11_[_loc12_] = _loc6_[_loc12_];
  291.             }
  292.             delete _loc11_.time;
  293.             _loc8_ = Number(Number(_loc11_.delay) || 0);
  294.             _loc11_.delay = _loc5_ + _loc8_;
  295.             _loc7_ = _loc11_.target;
  296.             delete _loc11_.target;
  297.             if(_loc4_ == 1)
  298.             {
  299.                if(_loc2_[_loc7_] == undefined)
  300.                {
  301.                   _loc2_[_loc7_] = _loc11_;
  302.                }
  303.                else
  304.                {
  305.                   _loc11_.overwrite = 2;
  306.                }
  307.             }
  308.             _loc3_[_loc3_.length] = new TweenMax(_loc7_,_loc9_,_loc11_);
  309.             _loc5_ += _loc9_ + _loc8_;
  310.             _loc10_++;
  311.          }
  312.          return _loc3_;
  313.       }
  314.       
  315.       public static function delayedCall(param1:Number, param2:Function, param3:Array = null, param4:Boolean = false) : TweenMax
  316.       {
  317.          return new TweenMax(param2,0,{
  318.             "delay":param1,
  319.             "onComplete":param2,
  320.             "onCompleteParams":param3,
  321.             "persist":param4,
  322.             "overwrite":0
  323.          });
  324.       }
  325.       
  326.       public static function isTweening(param1:Object) : Boolean
  327.       {
  328.          var _loc2_:Array = getTweensOf(param1);
  329.          var _loc3_:int = int(_loc2_.length - 1);
  330.          while(_loc3_ > -1)
  331.          {
  332.             if(_loc2_[_loc3_].active)
  333.             {
  334.                return true;
  335.             }
  336.             _loc3_--;
  337.          }
  338.          return false;
  339.       }
  340.       
  341.       public static function killAll(param1:Boolean = false, param2:Boolean = true, param3:Boolean = true) : void
  342.       {
  343.          var _loc5_:* = false;
  344.          var _loc4_:Array = getAllTweens();
  345.          var _loc6_:int = int(_loc4_.length - 1);
  346.          while(_loc6_ > -1)
  347.          {
  348.             _loc5_ = _loc4_[_loc6_].target == _loc4_[_loc6_].vars.onComplete;
  349.             if(_loc5_ == param3 || _loc5_ != param2)
  350.             {
  351.                if(param1)
  352.                {
  353.                   _loc4_[_loc6_].complete();
  354.                }
  355.                else
  356.                {
  357.                   TweenLite.removeTween(_loc4_[_loc6_]);
  358.                }
  359.             }
  360.             _loc6_--;
  361.          }
  362.       }
  363.       
  364.       public static function changePause(param1:Boolean, param2:Boolean = true, param3:Boolean = false) : void
  365.       {
  366.          var _loc5_:* = false;
  367.          var _loc4_:Array = getAllTweens();
  368.          var _loc6_:int = int(_loc4_.length - 1);
  369.          while(_loc6_ > -1)
  370.          {
  371.             _loc5_ = _loc4_[_loc6_].target == _loc4_[_loc6_].vars.onComplete;
  372.             if(_loc4_[_loc6_] is TweenMax && (_loc5_ == param3 || _loc5_ != param2))
  373.             {
  374.                _loc4_[_loc6_].paused = param1;
  375.             }
  376.             _loc6_--;
  377.          }
  378.       }
  379.       
  380.       public static function callbackProxy(param1:Array, param2:Array = null) : void
  381.       {
  382.          var _loc3_:uint = 0;
  383.          while(_loc3_ < param1.length)
  384.          {
  385.             if(param1[_loc3_] != undefined)
  386.             {
  387.                param1[_loc3_].apply(null,param2[_loc3_]);
  388.             }
  389.             _loc3_++;
  390.          }
  391.       }
  392.       
  393.       public static function allFrom(param1:Array, param2:Number, param3:Object) : Array
  394.       {
  395.          param3.runBackwards = true;
  396.          return allTo(param1,param2,param3);
  397.       }
  398.       
  399.       public static function from(param1:Object, param2:Number, param3:Object) : TweenMax
  400.       {
  401.          param3.runBackwards = true;
  402.          return new TweenMax(param1,param2,param3);
  403.       }
  404.       
  405.       public static function killAllTweens(param1:Boolean = false) : void
  406.       {
  407.          killAll(param1,true,false);
  408.       }
  409.       
  410.       public static function getAllTweens() : Array
  411.       {
  412.          var _loc3_:Object = null;
  413.          var _loc4_:Object = null;
  414.          var _loc1_:Dictionary = _all;
  415.          var _loc2_:Array = [];
  416.          for each(_loc3_ in _loc1_)
  417.          {
  418.             for(_loc4_ in _loc3_)
  419.             {
  420.                if(_loc3_[_loc4_] != undefined)
  421.                {
  422.                   _loc2_[_loc2_.length] = _loc3_[_loc4_];
  423.                }
  424.             }
  425.          }
  426.          return _loc2_;
  427.       }
  428.       
  429.       public static function resumeAll(param1:Boolean = true, param2:Boolean = false) : void
  430.       {
  431.          changePause(false,param1,param2);
  432.       }
  433.       
  434.       public static function to(param1:Object, param2:Number, param3:Object) : TweenMax
  435.       {
  436.          return new TweenMax(param1,param2,param3);
  437.       }
  438.       
  439.       public static function allTo(param1:Array, param2:Number, param3:Object) : Array
  440.       {
  441.          var _loc4_:int = 0;
  442.          var _loc5_:Object = null;
  443.          var _loc6_:String = null;
  444.          var _loc7_:Number = NaN;
  445.          var _loc8_:Object = null;
  446.          if(param1.length == 0)
  447.          {
  448.             return [];
  449.          }
  450.          var _loc9_:Array = [];
  451.          var _loc10_:Number = Number(Number(param3.delayIncrement) || 0);
  452.          delete param3.delayIncrement;
  453.          if(param3.onCompleteAll == undefined)
  454.          {
  455.             _loc8_ = param3;
  456.          }
  457.          else
  458.          {
  459.             _loc8_ = {};
  460.             for(_loc6_ in param3)
  461.             {
  462.                _loc8_[_loc6_] = param3[_loc6_];
  463.             }
  464.             _loc8_.onCompleteParams = [[param3.onComplete,param3.onCompleteAll],[param3.onCompleteParams,param3.onCompleteAllParams]];
  465.             _loc8_.onComplete = TweenMax.callbackProxy;
  466.             delete param3.onCompleteAll;
  467.          }
  468.          delete param3.onCompleteAllParams;
  469.          if(_loc10_ == 0)
  470.          {
  471.             _loc4_ = 0;
  472.             while(_loc4_ < param1.length - 1)
  473.             {
  474.                _loc5_ = {};
  475.                for(_loc6_ in param3)
  476.                {
  477.                   _loc5_[_loc6_] = param3[_loc6_];
  478.                }
  479.                _loc9_[_loc9_.length] = new TweenMax(param1[_loc4_],param2,_loc5_);
  480.                _loc4_++;
  481.             }
  482.          }
  483.          else
  484.          {
  485.             _loc7_ = Number(Number(param3.delay) || 0);
  486.             _loc4_ = 0;
  487.             while(_loc4_ < param1.length - 1)
  488.             {
  489.                _loc5_ = {};
  490.                for(_loc6_ in param3)
  491.                {
  492.                   _loc5_[_loc6_] = param3[_loc6_];
  493.                }
  494.                _loc5_.delay = _loc7_ + _loc4_ * _loc10_;
  495.                _loc9_[_loc9_.length] = new TweenMax(param1[_loc4_],param2,_loc5_);
  496.                _loc4_++;
  497.             }
  498.             _loc8_.delay = _loc7_ + (param1.length - 1) * _loc10_;
  499.          }
  500.          _loc9_[_loc9_.length] = new TweenMax(param1[param1.length - 1],param2,_loc8_);
  501.          if(param3.onCompleteAllListener is Function)
  502.          {
  503.             _loc9_[_loc9_.length - 1].addEventListener(TweenEvent.COMPLETE,param3.onCompleteAllListener);
  504.          }
  505.          return _loc9_;
  506.       }
  507.       
  508.       public function dispatchEvent(param1:Event) : Boolean
  509.       {
  510.          if(this._dispatcher == null)
  511.          {
  512.             return false;
  513.          }
  514.          return this._dispatcher.dispatchEvent(param1);
  515.       }
  516.       
  517.       public function get reversed() : Boolean
  518.       {
  519.          return this.vars.ease == this.reverseEase;
  520.       }
  521.       
  522.       protected function enable() : void
  523.       {
  524.          if(_all[this.target] == undefined)
  525.          {
  526.             _all[this.target] = new Dictionary(true);
  527.          }
  528.          if(_all[this.target][this] != this)
  529.          {
  530.             _timeScale = _uncombinedTimeScale * _globalTimeScale;
  531.             _all[this.target][this] = this;
  532.          }
  533.       }
  534.       
  535.       public function set reversed(param1:Boolean) : void
  536.       {
  537.          if(this.reversed != param1)
  538.          {
  539.             this.reverse();
  540.          }
  541.       }
  542.       
  543.       protected function onStartDispatcher(... rest) : void
  544.       {
  545.          if(this._callbacks.onStart != null)
  546.          {
  547.             this._callbacks.onStart.apply(null,this.vars.onStartParams);
  548.          }
  549.          this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
  550.       }
  551.       
  552.       public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  553.       {
  554.          if(this._dispatcher == null)
  555.          {
  556.             this.initDispatcher();
  557.          }
  558.          if(param1 == TweenEvent.UPDATE && this.vars.onUpdate != this.onUpdateDispatcher)
  559.          {
  560.             this.vars.onUpdate = this.onUpdateDispatcher;
  561.             _hasUpdate = true;
  562.          }
  563.          this._dispatcher.addEventListener(param1,param2,param3,param4,param5);
  564.       }
  565.       
  566.       public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  567.       {
  568.          if(this._dispatcher != null)
  569.          {
  570.             this._dispatcher.removeEventListener(param1,param2,param3);
  571.          }
  572.       }
  573.       
  574.       public function setDestination(param1:String, param2:*, param3:Boolean = true) : void
  575.       {
  576.          var _loc5_:Object = null;
  577.          var _loc6_:int = 0;
  578.          var _loc7_:Object = null;
  579.          var _loc8_:Array = null;
  580.          var _loc9_:Array = null;
  581.          var _loc4_:Number = this.progress;
  582.          if(this.vars[param1] != undefined && _initted)
  583.          {
  584.             if(!param3 && _loc4_ != 0)
  585.             {
  586.                _loc6_ = int(this.tweens.length - 1);
  587.                while(_loc6_ > -1)
  588.                {
  589.                   if(this.tweens[_loc6_].name == param1)
  590.                   {
  591.                      this.tweens[_loc6_].o[this.tweens[_loc6_].p] = this.tweens[_loc6_].s;
  592.                   }
  593.                   _loc6_--;
  594.                }
  595.             }
  596.             _loc5_ = {};
  597.             _loc5_[param1] = 1;
  598.             killVars(_loc5_);
  599.          }
  600.          this.vars[param1] = param2;
  601.          if(_initted)
  602.          {
  603.             _loc7_ = this.vars;
  604.             _loc8_ = this.tweens;
  605.             _loc9_ = _subTweens;
  606.             this.vars = {};
  607.             this.tweens = [];
  608.             _subTweens = [];
  609.             this.vars[param1] = param2;
  610.             this.initTweenVals();
  611.             if(param3 && _loc4_ != 0)
  612.             {
  613.                this.vars.ease = _loc7_.ease;
  614.                this.adjustStartValues();
  615.             }
  616.             this.vars = _loc7_;
  617.             this.tweens = _loc8_.concat(this.tweens);
  618.             _subTweens = _loc9_.concat(_subTweens);
  619.          }
  620.       }
  621.       
  622.       override public function initTweenVals(param1:Boolean = false, param2:String = "") : void
  623.       {
  624.          var _loc3_:String = null;
  625.          var _loc4_:int = 0;
  626.          var _loc5_:Object = null;
  627.          var _loc6_:Object = null;
  628.          var _loc7_:Array = null;
  629.          param2 += " hexColors bezier bezierThrough orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop onCompleteListener onUpdateListener onStartListener ";
  630.          if(!param1 && this.delay != 0 && Boolean(TweenLite.overwriteManager.enabled))
  631.          {
  632.             TweenLite.overwriteManager.manageOverwrites(this,_all[this.target]);
  633.          }
  634.          var _loc8_:Function = bezierProxy;
  635.          if(this.vars.orientToBezier == true)
  636.          {
  637.             this.vars.orientToBezier = [["x","y","rotation",0]];
  638.             _loc8_ = bezierProxy2;
  639.          }
  640.          else if(this.vars.orientToBezier is Array)
  641.          {
  642.             _loc8_ = bezierProxy2;
  643.          }
  644.          if(this.vars.bezier != undefined && this.vars.bezier is Array)
  645.          {
  646.             _loc6_ = {};
  647.             _loc7_ = this.vars.bezier;
  648.             _loc4_ = 0;
  649.             while(_loc4_ < _loc7_.length)
  650.             {
  651.                for(_loc3_ in _loc7_[_loc4_])
  652.                {
  653.                   if(_loc6_[_loc3_] == undefined)
  654.                   {
  655.                      _loc6_[_loc3_] = [this.target[_loc3_]];
  656.                   }
  657.                   if(typeof _loc7_[_loc4_][_loc3_] == "number")
  658.                   {
  659.                      _loc6_[_loc3_].push(_loc7_[_loc4_][_loc3_]);
  660.                   }
  661.                   else
  662.                   {
  663.                      _loc6_[_loc3_].push(this.target[_loc3_] + Number(_loc7_[_loc4_][_loc3_]));
  664.                   }
  665.                }
  666.                _loc4_++;
  667.             }
  668.             for(_loc3_ in _loc6_)
  669.             {
  670.                if(typeof this.vars[_loc3_] == "number")
  671.                {
  672.                   _loc6_[_loc3_].push(this.vars[_loc3_]);
  673.                }
  674.                else
  675.                {
  676.                   _loc6_[_loc3_].push(this.target[_loc3_] + Number(this.vars[_loc3_]));
  677.                }
  678.                delete this.vars[_loc3_];
  679.             }
  680.             addSubTween("bezier",_loc8_,{"t":0},{"t":1},{
  681.                "props":parseBeziers(_loc6_,false),
  682.                "target":this.target,
  683.                "orientToBezier":this.vars.orientToBezier
  684.             });
  685.          }
  686.          if(this.vars.bezierThrough != undefined && this.vars.bezierThrough is Array)
  687.          {
  688.             _loc6_ = {};
  689.             _loc7_ = this.vars.bezierThrough;
  690.             _loc4_ = 0;
  691.             while(_loc4_ < _loc7_.length)
  692.             {
  693.                for(_loc3_ in _loc7_[_loc4_])
  694.                {
  695.                   if(_loc6_[_loc3_] == undefined)
  696.                   {
  697.                      _loc6_[_loc3_] = [this.target[_loc3_]];
  698.                   }
  699.                   if(typeof _loc7_[_loc4_][_loc3_] == "number")
  700.                   {
  701.                      _loc6_[_loc3_].push(_loc7_[_loc4_][_loc3_]);
  702.                   }
  703.                   else
  704.                   {
  705.                      _loc6_[_loc3_].push(this.target[_loc3_] + Number(_loc7_[_loc4_][_loc3_]));
  706.                   }
  707.                }
  708.                _loc4_++;
  709.             }
  710.             for(_loc3_ in _loc6_)
  711.             {
  712.                if(typeof this.vars[_loc3_] == "number")
  713.                {
  714.                   _loc6_[_loc3_].push(this.vars[_loc3_]);
  715.                }
  716.                else
  717.                {
  718.                   _loc6_[_loc3_].push(this.target[_loc3_] + Number(this.vars[_loc3_]));
  719.                }
  720.                delete this.vars[_loc3_];
  721.             }
  722.             addSubTween("bezierThrough",_loc8_,{"t":0},{"t":1},{
  723.                "props":parseBeziers(_loc6_,true),
  724.                "target":this.target,
  725.                "orientToBezier":this.vars.orientToBezier
  726.             });
  727.          }
  728.          if(this.vars.hexColors != undefined && typeof this.vars.hexColors == "object")
  729.          {
  730.             for(_loc3_ in this.vars.hexColors)
  731.             {
  732.                addSubTween("hexColors",hexColorsProxy,{
  733.                   "r":this.target[_loc3_] >> 16,
  734.                   "g":this.target[_loc3_] >> 8 & 0xFF,
  735.                   "b":this.target[_loc3_] & 0xFF
  736.                },{
  737.                   "r":this.vars.hexColors[_loc3_] >> 16,
  738.                   "g":this.vars.hexColors[_loc3_] >> 8 & 0xFF,
  739.                   "b":this.vars.hexColors[_loc3_] & 0xFF
  740.                },{
  741.                   "prop":_loc3_,
  742.                   "target":this.target
  743.                });
  744.             }
  745.          }
  746.          super.initTweenVals(true,param2);
  747.       }
  748.       
  749.       protected function adjustStartValues() : void
  750.       {
  751.          var _loc2_:Number = NaN;
  752.          var _loc3_:Number = NaN;
  753.          var _loc4_:Object = null;
  754.          var _loc5_:int = 0;
  755.          var _loc1_:Number = this.progress;
  756.          if(_loc1_ != 0)
  757.          {
  758.             _loc2_ = 1 / (1 - this.vars.ease(_loc1_ * this.duration,0,1,this.duration));
  759.             _loc5_ = int(this.tweens.length - 1);
  760.             while(_loc5_ > -1)
  761.             {
  762.                _loc4_ = this.tweens[_loc5_];
  763.                _loc3_ = _loc4_.s + _loc4_.c;
  764.                _loc4_.c = (_loc3_ - _loc4_.o[_loc4_.p]) * _loc2_;
  765.                _loc4_.s = _loc3_ - _loc4_.c;
  766.                _loc5_--;
  767.             }
  768.          }
  769.       }
  770.       
  771.       public function restart(param1:Boolean = false) : void
  772.       {
  773.          if(param1)
  774.          {
  775.             this.initTime = _curTime;
  776.             this.startTime = _curTime + this.delay * (1000 / _timeScale);
  777.          }
  778.          else
  779.          {
  780.             this.startTime = _curTime;
  781.             this.initTime = _curTime - this.delay * (1000 / _timeScale);
  782.          }
  783.          if(this.target != this.vars.onComplete)
  784.          {
  785.             render(this.startTime);
  786.          }
  787.          this._pauseTime = -1;
  788.          this.enable();
  789.       }
  790.       
  791.       protected function initDispatcher() : void
  792.       {
  793.          var _loc1_:Object = null;
  794.          var _loc2_:String = null;
  795.          if(this._dispatcher == null)
  796.          {
  797.             this._dispatcher = new EventDispatcher(this);
  798.             this._callbacks = {
  799.                "onStart":this.vars.onStart,
  800.                "onUpdate":this.vars.onUpdate,
  801.                "onComplete":this.vars.onComplete
  802.             };
  803.             _loc1_ = {};
  804.             for(_loc2_ in this.vars)
  805.             {
  806.                _loc1_[_loc2_] = this.vars[_loc2_];
  807.             }
  808.             this.vars = _loc1_;
  809.             this.vars.onStart = this.onStartDispatcher;
  810.             this.vars.onComplete = this.onCompleteDispatcher;
  811.             if(this.vars.onStartListener is Function)
  812.             {
  813.                this._dispatcher.addEventListener(TweenEvent.START,this.vars.onStartListener,false,0,true);
  814.             }
  815.             if(this.vars.onUpdateListener is Function)
  816.             {
  817.                this._dispatcher.addEventListener(TweenEvent.UPDATE,this.vars.onUpdateListener,false,0,true);
  818.                this.vars.onUpdate = this.onUpdateDispatcher;
  819.                _hasUpdate = true;
  820.             }
  821.             if(this.vars.onCompleteListener is Function)
  822.             {
  823.                this._dispatcher.addEventListener(TweenEvent.COMPLETE,this.vars.onCompleteListener,false,0,true);
  824.             }
  825.          }
  826.       }
  827.       
  828.       protected function onUpdateDispatcher(... rest) : void
  829.       {
  830.          if(this._callbacks.onUpdate != null)
  831.          {
  832.             this._callbacks.onUpdate.apply(null,this.vars.onUpdateParams);
  833.          }
  834.          this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
  835.       }
  836.       
  837.       public function reverse(param1:Boolean = true) : void
  838.       {
  839.          this.vars.ease = this.vars.ease == _originalEase ? this.reverseEase : _originalEase;
  840.          var _loc2_:Number = this.progress;
  841.          if(this._pauseTime != -1)
  842.          {
  843.             if(_loc2_ < 1)
  844.             {
  845.                this.resume();
  846.             }
  847.             else
  848.             {
  849.                this._pauseTime = -1;
  850.                _active = true;
  851.             }
  852.          }
  853.          if(param1 && _loc2_ > 0)
  854.          {
  855.             this.startTime = _curTime - (1 - _loc2_) * this.duration * 1000 / _timeScale;
  856.             this.initTime = this.startTime - this.delay * (1000 / _timeScale);
  857.          }
  858.          this.enable();
  859.       }
  860.       
  861.       public function set paused(param1:Boolean) : void
  862.       {
  863.          if(param1)
  864.          {
  865.             this.pause();
  866.          }
  867.          else
  868.          {
  869.             this.resume();
  870.          }
  871.       }
  872.       
  873.       public function willTrigger(param1:String) : Boolean
  874.       {
  875.          if(this._dispatcher == null)
  876.          {
  877.             return false;
  878.          }
  879.          return this._dispatcher.willTrigger(param1);
  880.       }
  881.       
  882.       override public function get active() : Boolean
  883.       {
  884.          if(_active)
  885.          {
  886.             return true;
  887.          }
  888.          if(this._pauseTime != -1)
  889.          {
  890.             return false;
  891.          }
  892.          if(_curTime >= this.startTime)
  893.          {
  894.             _active = true;
  895.             if(!_initted)
  896.             {
  897.                this.initTweenVals();
  898.             }
  899.             else if(this.vars.visible != undefined && _isDisplayObject)
  900.             {
  901.                this.target.visible = true;
  902.             }
  903.             if(this.vars.onStart != null)
  904.             {
  905.                this.vars.onStart.apply(null,this.vars.onStartParams);
  906.             }
  907.             if(this.duration == 0.001)
  908.             {
  909.                --this.startTime;
  910.             }
  911.             return true;
  912.          }
  913.          return false;
  914.       }
  915.       
  916.       public function resume() : void
  917.       {
  918.          var _loc1_:Number = NaN;
  919.          var _loc2_:* = false;
  920.          var _loc3_:Number = NaN;
  921.          if(this._pauseTime != -1)
  922.          {
  923.             _loc1_ = this.delay * (1000 / _timeScale);
  924.             _loc2_ = this._pauseTime > this.initTime + _loc1_;
  925.             _loc3_ = _curTime - this._pauseTime;
  926.             this.initTime += _loc3_;
  927.             this.startTime = this.initTime + _loc1_;
  928.             this._pauseTime = -1;
  929.             if(!_loc2_ && _curTime >= this.startTime)
  930.             {
  931.                _loc2_ = this.active;
  932.             }
  933.             else
  934.             {
  935.                _active = _loc2_;
  936.             }
  937.          }
  938.          this.enable();
  939.       }
  940.       
  941.       public function get paused() : Boolean
  942.       {
  943.          return this._pauseTime != -1;
  944.       }
  945.       
  946.       public function reverseEase(param1:Number, param2:Number, param3:Number, param4:Number) : Number
  947.       {
  948.          return _originalEase(param4 - param1,param2,param3,param4);
  949.       }
  950.       
  951.       public function killProperties(param1:Array) : void
  952.       {
  953.          var _loc3_:int = 0;
  954.          var _loc2_:Object = {};
  955.          _loc3_ = int(param1.length - 1);
  956.          while(_loc3_ > -1)
  957.          {
  958.             if(this.vars[param1[_loc3_]] != null)
  959.             {
  960.                _loc2_[param1[_loc3_]] = 1;
  961.             }
  962.             _loc3_--;
  963.          }
  964.          killVars(_loc2_);
  965.       }
  966.       
  967.       public function set progress(param1:Number) : void
  968.       {
  969.          this.startTime = _curTime - this.duration * param1 * 1000;
  970.          this.initTime = this.startTime - this.delay * (1000 / _timeScale);
  971.          var _loc2_:Boolean = this.active;
  972.          render(_curTime);
  973.          if(this._pauseTime != -1)
  974.          {
  975.             this._pauseTime = _curTime;
  976.             this.startTime = 99999999999;
  977.          }
  978.          var _loc3_:* = this.vars.visible;
  979.          if(this.vars.isTV == true)
  980.          {
  981.             _loc3_ = this.vars.exposedProps.visible;
  982.          }
  983.          if(_loc3_ != null && _isDisplayObject && param1 < 1)
  984.          {
  985.             this.target.visible = Boolean(_loc3_);
  986.          }
  987.       }
  988.       
  989.       public function hasEventListener(param1:String) : Boolean
  990.       {
  991.          if(this._dispatcher == null)
  992.          {
  993.             return false;
  994.          }
  995.          return this._dispatcher.hasEventListener(param1);
  996.       }
  997.       
  998.       public function pause() : void
  999.       {
  1000.          if(this._pauseTime == -1)
  1001.          {
  1002.             this._pauseTime = _curTime;
  1003.             this.startTime = 99999999999;
  1004.             _active = false;
  1005.          }
  1006.       }
  1007.       
  1008.       override public function complete(param1:Boolean = false) : void
  1009.       {
  1010.          if(this.vars.yoyo == true || this.vars.loop == true)
  1011.          {
  1012.             if(this.vars.yoyo == true)
  1013.             {
  1014.                this.reverse(false);
  1015.             }
  1016.             this.startTime = _curTime;
  1017.             this.initTime = this.startTime - this.delay * (1000 / _timeScale);
  1018.          }
  1019.          else if(this.vars.persist == true)
  1020.          {
  1021.             this.pause();
  1022.          }
  1023.          super.complete(param1);
  1024.       }
  1025.       
  1026.       public function invalidate(param1:Boolean = true) : void
  1027.       {
  1028.          var _loc2_:Number = NaN;
  1029.          if(_initted)
  1030.          {
  1031.             _loc2_ = this.progress;
  1032.             if(!param1 && _loc2_ != 0)
  1033.             {
  1034.                this.progress = 0;
  1035.             }
  1036.             this.tweens = [];
  1037.             _subTweens = [];
  1038.             this.initTweenVals();
  1039.             _timeScale = (this.vars.timeScale || 1) * _globalTimeScale;
  1040.             if(this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null)
  1041.             {
  1042.                if(this._dispatcher != null)
  1043.                {
  1044.                   this.vars.onStart = this._callbacks.onStart;
  1045.                   this.vars.onUpdate = this._callbacks.onUpdate;
  1046.                   this.vars.onComplete = this._callbacks.onComplete;
  1047.                   this._dispatcher = null;
  1048.                }
  1049.                this.initDispatcher();
  1050.             }
  1051.             if(_loc2_ != 0)
  1052.             {
  1053.                if(param1)
  1054.                {
  1055.                   this.adjustStartValues();
  1056.                }
  1057.                else
  1058.                {
  1059.                   this.progress = _loc2_;
  1060.                }
  1061.             }
  1062.          }
  1063.       }
  1064.       
  1065.       public function get progress() : Number
  1066.       {
  1067.          var _loc1_:Number = this._pauseTime != -1 ? this._pauseTime : _curTime;
  1068.          var _loc2_:Number = ((_loc1_ - this.initTime) / 1000 - this.delay / _timeScale) / this.duration * _timeScale;
  1069.          if(_loc2_ > 1)
  1070.          {
  1071.             return 1;
  1072.          }
  1073.          if(_loc2_ < 0)
  1074.          {
  1075.             return 0;
  1076.          }
  1077.          return _loc2_;
  1078.       }
  1079.       
  1080.       protected function onCompleteDispatcher(... rest) : void
  1081.       {
  1082.          if(this._callbacks.onComplete != null)
  1083.          {
  1084.             this._callbacks.onComplete.apply(null,this.vars.onCompleteParams);
  1085.          }
  1086.          this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
  1087.       }
  1088.    }
  1089. }
  1090.  
  1091.