home *** CD-ROM | disk | FTP | other *** search
/ Ice Age Fan CD 1 / CD1_Scrat.iso / flash / data / game.swf / scripts / gs / TweenMax.as < prev   
Encoding:
Text File  |  2012-07-04  |  25.7 KB  |  819 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 = 1.41;
  12.       
  13.       protected static const _RAD2DEG:Number = 180 / Math.PI;
  14.       
  15.       public static var killTweensOf:Function = TweenLite.killTweensOf;
  16.       
  17.       public static var killDelayedCallsTo:Function = TweenLite.killDelayedCallsTo;
  18.       
  19.       public static var removeTween:Function = TweenLite.removeTween;
  20.       
  21.       public static var defaultEase:Function = TweenLite.defaultEase;
  22.       
  23.       protected var _pauseTime:int;
  24.       
  25.       protected var _dispatcher:EventDispatcher;
  26.       
  27.       protected var _callbacks:Object;
  28.       
  29.       public function TweenMax(param1:Object, param2:Number, param3:Object)
  30.       {
  31.          super(param1,param2,param3);
  32.          _pauseTime = -1;
  33.          if(this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null)
  34.          {
  35.             initDispatcher();
  36.             if(param2 == 0 && this.delay == 0)
  37.             {
  38.                onUpdateDispatcher();
  39.                onCompleteDispatcher();
  40.             }
  41.          }
  42.          if(TweenFilterLite.version < 7.31 || isNaN(TweenFilterLite.version))
  43.          {
  44.          }
  45.       }
  46.       
  47.       public static function to(param1:Object, param2:Number, param3:Object) : TweenMax
  48.       {
  49.          return new TweenMax(param1,param2,param3);
  50.       }
  51.       
  52.       public static function from(param1:Object, param2:Number, param3:Object) : TweenMax
  53.       {
  54.          param3.runBackwards = true;
  55.          return new TweenMax(param1,param2,param3);
  56.       }
  57.       
  58.       public static function allTo(param1:Array, param2:Number, param3:Object) : Array
  59.       {
  60.          var _loc4_:int = 0;
  61.          var _loc5_:Object = null;
  62.          var _loc6_:String = null;
  63.          var _loc7_:Number = NaN;
  64.          var _loc8_:Object = null;
  65.          if(param1.length == 0)
  66.          {
  67.             return [];
  68.          }
  69.          var _loc9_:Array = [];
  70.          var _loc10_:Number = Number(Number(param3.delayIncrement) || 0);
  71.          delete param3.delayIncrement;
  72.          if(param3.onCompleteAll == undefined)
  73.          {
  74.             _loc8_ = param3;
  75.          }
  76.          else
  77.          {
  78.             _loc8_ = {};
  79.             for(_loc6_ in param3)
  80.             {
  81.                _loc8_[_loc6_] = param3[_loc6_];
  82.             }
  83.             _loc8_.onCompleteParams = [[param3.onComplete,param3.onCompleteAll],[param3.onCompleteParams,param3.onCompleteAllParams]];
  84.             _loc8_.onComplete = TweenMax.callbackProxy;
  85.             delete param3.onCompleteAll;
  86.          }
  87.          delete param3.onCompleteAllParams;
  88.          if(_loc10_ == 0)
  89.          {
  90.             _loc4_ = 0;
  91.             while(_loc4_ < param1.length - 1)
  92.             {
  93.                _loc5_ = {};
  94.                for(_loc6_ in param3)
  95.                {
  96.                   _loc5_[_loc6_] = param3[_loc6_];
  97.                }
  98.                _loc9_.push(new TweenMax(param1[_loc4_],param2,_loc5_));
  99.                _loc4_++;
  100.             }
  101.          }
  102.          else
  103.          {
  104.             _loc7_ = Number(Number(param3.delay) || 0);
  105.             _loc4_ = 0;
  106.             while(_loc4_ < param1.length - 1)
  107.             {
  108.                _loc5_ = {};
  109.                for(_loc6_ in param3)
  110.                {
  111.                   _loc5_[_loc6_] = param3[_loc6_];
  112.                }
  113.                _loc5_.delay = _loc7_ + _loc4_ * _loc10_;
  114.                _loc9_.push(new TweenMax(param1[_loc4_],param2,_loc5_));
  115.                _loc4_++;
  116.             }
  117.             _loc8_.delay = _loc7_ + (param1.length - 1) * _loc10_;
  118.          }
  119.          _loc9_.push(new TweenMax(param1[param1.length - 1],param2,_loc8_));
  120.          if(param3.onCompleteAllListener is Function)
  121.          {
  122.             _loc9_[_loc9_.length - 1].addEventListener(TweenEvent.COMPLETE,param3.onCompleteAllListener);
  123.          }
  124.          return _loc9_;
  125.       }
  126.       
  127.       public static function allFrom(param1:Array, param2:Number, param3:Object) : Array
  128.       {
  129.          param3.runBackwards = true;
  130.          return allTo(param1,param2,param3);
  131.       }
  132.       
  133.       public static function callbackProxy(param1:Array, param2:Array = null) : void
  134.       {
  135.          var _loc3_:uint = 0;
  136.          while(_loc3_ < param1.length)
  137.          {
  138.             if(param1[_loc3_] != undefined)
  139.             {
  140.                param1[_loc3_].apply(null,param2[_loc3_]);
  141.             }
  142.             _loc3_++;
  143.          }
  144.       }
  145.       
  146.       public static function sequence(param1:Object, param2:Array) : Array
  147.       {
  148.          var _loc3_:uint = 0;
  149.          while(_loc3_ < param2.length)
  150.          {
  151.             param2[_loc3_].target = param1;
  152.             _loc3_++;
  153.          }
  154.          return multiSequence(param2);
  155.       }
  156.       
  157.       public static function multiSequence(param1:Array) : Array
  158.       {
  159.          var _loc5_:Object = null;
  160.          var _loc6_:Object = null;
  161.          var _loc7_:Number = NaN;
  162.          var _loc8_:Number = NaN;
  163.          var _loc9_:uint = 0;
  164.          var _loc10_:Object = null;
  165.          var _loc11_:String = null;
  166.          var _loc2_:Dictionary = new Dictionary();
  167.          var _loc3_:Array = [];
  168.          var _loc4_:Number = 0;
  169.          _loc9_ = 0;
  170.          while(_loc9_ < param1.length)
  171.          {
  172.             _loc5_ = param1[_loc9_];
  173.             _loc8_ = Number(Number(_loc5_.time) || 0);
  174.             _loc10_ = {};
  175.             for(_loc11_ in _loc5_)
  176.             {
  177.                _loc10_[_loc11_] = _loc5_[_loc11_];
  178.             }
  179.             delete _loc10_.time;
  180.             _loc7_ = Number(Number(_loc10_.delay) || 0);
  181.             _loc10_.delay = _loc4_ + _loc7_;
  182.             _loc6_ = _loc10_.target;
  183.             delete _loc10_.target;
  184.             if(_loc2_[_loc6_] == undefined)
  185.             {
  186.                if(_loc10_.overwrite == undefined)
  187.                {
  188.                   _loc10_.overwrite = true;
  189.                }
  190.                _loc2_[_loc6_] = _loc10_;
  191.             }
  192.             else
  193.             {
  194.                _loc10_.overwrite = false;
  195.             }
  196.             _loc3_.push(new TweenMax(_loc6_,_loc8_,_loc10_));
  197.             _loc4_ += _loc8_ + _loc7_;
  198.             _loc9_++;
  199.          }
  200.          return _loc3_;
  201.       }
  202.       
  203.       public static function delayedCall(param1:Number, param2:Function, param3:Array = null) : TweenMax
  204.       {
  205.          return new TweenMax(param2,0,{
  206.             "delay":param1,
  207.             "onComplete":param2,
  208.             "onCompleteParams":param3,
  209.             "overwrite":false
  210.          });
  211.       }
  212.       
  213.       public static function parseBeziers(param1:Object, param2:Boolean = false) : Object
  214.       {
  215.          var _loc3_:int = 0;
  216.          var _loc4_:Array = null;
  217.          var _loc5_:Object = null;
  218.          var _loc6_:String = null;
  219.          var _loc7_:Object = {};
  220.          if(param2)
  221.          {
  222.             for(_loc6_ in param1)
  223.             {
  224.                _loc4_ = param1[_loc6_];
  225.                _loc7_[_loc6_] = _loc5_ = [];
  226.                if(_loc4_.length > 2)
  227.                {
  228.                   _loc5_.push({
  229.                      "s":_loc4_[0],
  230.                      "cp":_loc4_[1] - (_loc4_[2] - _loc4_[0]) / 4,
  231.                      "e":_loc4_[1]
  232.                   });
  233.                   _loc3_ = 1;
  234.                   while(_loc3_ < _loc4_.length - 1)
  235.                   {
  236.                      _loc5_.push({
  237.                         "s":_loc4_[_loc3_],
  238.                         "cp":_loc4_[_loc3_] + (_loc4_[_loc3_] - _loc5_[_loc3_ - 1].cp),
  239.                         "e":_loc4_[_loc3_ + 1]
  240.                      });
  241.                      _loc3_++;
  242.                   }
  243.                }
  244.                else
  245.                {
  246.                   _loc5_.push({
  247.                      "s":_loc4_[0],
  248.                      "cp":(_loc4_[0] + _loc4_[1]) / 2,
  249.                      "e":_loc4_[1]
  250.                   });
  251.                }
  252.             }
  253.          }
  254.          else
  255.          {
  256.             for(_loc6_ in param1)
  257.             {
  258.                _loc4_ = param1[_loc6_];
  259.                _loc7_[_loc6_] = _loc5_ = [];
  260.                if(_loc4_.length > 3)
  261.                {
  262.                   _loc5_.push({
  263.                      "s":_loc4_[0],
  264.                      "cp":_loc4_[1],
  265.                      "e":(_loc4_[1] + _loc4_[2]) / 2
  266.                   });
  267.                   _loc3_ = 2;
  268.                   while(_loc3_ < _loc4_.length - 2)
  269.                   {
  270.                      _loc5_.push({
  271.                         "s":_loc5_[_loc3_ - 2].e,
  272.                         "cp":_loc4_[_loc3_],
  273.                         "e":(_loc4_[_loc3_] + _loc4_[_loc3_ + 1]) / 2
  274.                      });
  275.                      _loc3_++;
  276.                   }
  277.                   _loc5_.push({
  278.                      "s":_loc5_[_loc5_.length - 1].e,
  279.                      "cp":_loc4_[_loc4_.length - 2],
  280.                      "e":_loc4_[_loc4_.length - 1]
  281.                   });
  282.                }
  283.                else if(_loc4_.length == 3)
  284.                {
  285.                   _loc5_.push({
  286.                      "s":_loc4_[0],
  287.                      "cp":_loc4_[1],
  288.                      "e":_loc4_[2]
  289.                   });
  290.                }
  291.                else if(_loc4_.length == 2)
  292.                {
  293.                   _loc5_.push({
  294.                      "s":_loc4_[0],
  295.                      "cp":(_loc4_[0] + _loc4_[1]) / 2,
  296.                      "e":_loc4_[1]
  297.                   });
  298.                }
  299.             }
  300.          }
  301.          return _loc7_;
  302.       }
  303.       
  304.       public static function getTweensOf(param1:Object) : Array
  305.       {
  306.          var _loc4_:Object = null;
  307.          var _loc2_:Dictionary = _all[param1];
  308.          var _loc3_:Array = [];
  309.          if(_loc2_ != null)
  310.          {
  311.             for(_loc4_ in _loc2_)
  312.             {
  313.                if(_loc2_[_loc4_].tweens != undefined)
  314.                {
  315.                   _loc3_.push(_loc2_[_loc4_]);
  316.                }
  317.             }
  318.          }
  319.          return _loc3_;
  320.       }
  321.       
  322.       public static function isTweening(param1:Object) : Boolean
  323.       {
  324.          var _loc2_:Array = getTweensOf(param1);
  325.          var _loc3_:int = int(_loc2_.length - 1);
  326.          while(_loc3_ > -1)
  327.          {
  328.             if(_loc2_[_loc3_].active)
  329.             {
  330.                return true;
  331.             }
  332.             _loc3_--;
  333.          }
  334.          return false;
  335.       }
  336.       
  337.       public static function getAllTweens() : Array
  338.       {
  339.          var _loc3_:Object = null;
  340.          var _loc4_:Object = null;
  341.          var _loc1_:Dictionary = _all;
  342.          var _loc2_:Array = [];
  343.          for(_loc3_ in _loc1_)
  344.          {
  345.             for(_loc4_ in _loc1_[_loc3_])
  346.             {
  347.                if(_loc1_[_loc3_][_loc4_] != undefined)
  348.                {
  349.                   _loc2_.push(_loc1_[_loc3_][_loc4_]);
  350.                }
  351.             }
  352.          }
  353.          return _loc2_;
  354.       }
  355.       
  356.       public static function killAllTweens(param1:Boolean = false) : void
  357.       {
  358.          killAll(param1,true,false);
  359.       }
  360.       
  361.       public static function killAllDelayedCalls(param1:Boolean = false) : void
  362.       {
  363.          killAll(param1,false,true);
  364.       }
  365.       
  366.       public static function killAll(param1:Boolean = false, param2:Boolean = true, param3:Boolean = true) : void
  367.       {
  368.          var _loc4_:Array = getAllTweens();
  369.          var _loc5_:int = int(_loc4_.length - 1);
  370.          while(_loc5_ > -1)
  371.          {
  372.             if(_loc4_[_loc5_].target is Function == param3 || _loc4_[_loc5_].target is Function != param2)
  373.             {
  374.                if(param1)
  375.                {
  376.                   _loc4_[_loc5_].complete();
  377.                }
  378.                else
  379.                {
  380.                   TweenLite.removeTween(_loc4_[_loc5_]);
  381.                }
  382.             }
  383.             _loc5_--;
  384.          }
  385.       }
  386.       
  387.       public static function pauseAll(param1:Boolean = true, param2:Boolean = false) : void
  388.       {
  389.          changePause(true,param1,param2);
  390.       }
  391.       
  392.       public static function resumeAll(param1:Boolean = true, param2:Boolean = false) : void
  393.       {
  394.          changePause(false,param1,param2);
  395.       }
  396.       
  397.       public static function changePause(param1:Boolean, param2:Boolean = true, param3:Boolean = false) : void
  398.       {
  399.          var _loc4_:Array = getAllTweens();
  400.          var _loc5_:int = int(_loc4_.length - 1);
  401.          while(_loc5_ > -1)
  402.          {
  403.             if(_loc4_[_loc5_].target is Function == param3 || _loc4_[_loc5_].target is Function != param2)
  404.             {
  405.                _loc4_[_loc5_].paused = param1;
  406.             }
  407.             _loc5_--;
  408.          }
  409.       }
  410.       
  411.       public static function hexColorsProxy(param1:Object) : void
  412.       {
  413.          param1.info.target[param1.info.prop] = param1.target.r << 16 | param1.target.g << 8 | param1.target.b;
  414.       }
  415.       
  416.       public static function bezierProxy(param1:Object) : void
  417.       {
  418.          var _loc5_:int = 0;
  419.          var _loc6_:String = null;
  420.          var _loc7_:Object = null;
  421.          var _loc8_:Number = NaN;
  422.          var _loc9_:uint = 0;
  423.          var _loc2_:Number = Number(param1.target.t);
  424.          var _loc3_:Object = param1.info.props;
  425.          var _loc4_:Object = param1.info.target;
  426.          for(_loc6_ in _loc3_)
  427.          {
  428.             _loc9_ = uint(_loc3_[_loc6_].length);
  429.             if(_loc2_ < 0)
  430.             {
  431.                _loc5_ = 0;
  432.             }
  433.             else if(_loc2_ >= 1)
  434.             {
  435.                _loc5_ = int(_loc9_ - 1);
  436.             }
  437.             else
  438.             {
  439.                _loc5_ = int(_loc9_ * _loc2_);
  440.             }
  441.             _loc8_ = (_loc2_ - _loc5_ * (1 / _loc9_)) * _loc9_;
  442.             _loc7_ = _loc3_[_loc6_][_loc5_];
  443.             _loc4_[_loc6_] = _loc7_.s + _loc8_ * (2 * (1 - _loc8_) * (_loc7_.cp - _loc7_.s) + _loc8_ * (_loc7_.e - _loc7_.s));
  444.          }
  445.       }
  446.       
  447.       public static function bezierProxy2(param1:Object) : void
  448.       {
  449.          var _loc5_:Number = NaN;
  450.          var _loc6_:Number = NaN;
  451.          var _loc7_:Number = NaN;
  452.          var _loc8_:Array = null;
  453.          var _loc9_:Number = NaN;
  454.          bezierProxy(param1);
  455.          var _loc2_:Object = {};
  456.          var _loc3_:Object = param1.info.target;
  457.          param1.info.target = _loc2_;
  458.          param1.target.t += 0.01;
  459.          bezierProxy(param1);
  460.          var _loc4_:Array = param1.info.orientToBezier;
  461.          var _loc10_:uint = 0;
  462.          while(_loc10_ < _loc4_.length)
  463.          {
  464.             _loc8_ = _loc4_[_loc10_];
  465.             _loc9_ = Number(Number(_loc8_[3]) || 0);
  466.             _loc6_ = _loc2_[_loc8_[0]] - _loc3_[_loc8_[0]];
  467.             _loc7_ = _loc2_[_loc8_[1]] - _loc3_[_loc8_[1]];
  468.             _loc3_[_loc8_[2]] = Math.atan2(_loc7_,_loc6_) * _RAD2DEG + _loc9_;
  469.             _loc10_++;
  470.          }
  471.          param1.info.target = _loc3_;
  472.          param1.target.t -= 0.01;
  473.       }
  474.       
  475.       override public function initTweenVals(param1:Boolean = false, param2:String = "") : void
  476.       {
  477.          var _loc3_:String = null;
  478.          var _loc4_:int = 0;
  479.          var _loc5_:Object = null;
  480.          var _loc6_:Object = null;
  481.          var _loc7_:Array = null;
  482.          param2 += " hexColors bezier bezierThrough orientToBezier quaternions onCompleteAll onCompleteAllParams ";
  483.          var _loc8_:Function = bezierProxy;
  484.          if(this.vars.orientToBezier == true)
  485.          {
  486.             this.vars.orientToBezier = [["x","y","rotation",0]];
  487.             _loc8_ = bezierProxy2;
  488.          }
  489.          else if(this.vars.orientToBezier is Array)
  490.          {
  491.             _loc8_ = bezierProxy2;
  492.          }
  493.          if(this.vars.bezier != undefined && this.vars.bezier is Array)
  494.          {
  495.             _loc6_ = {};
  496.             _loc7_ = this.vars.bezier;
  497.             _loc4_ = 0;
  498.             while(_loc4_ < _loc7_.length)
  499.             {
  500.                for(_loc3_ in _loc7_[_loc4_])
  501.                {
  502.                   if(_loc6_[_loc3_] == undefined)
  503.                   {
  504.                      _loc6_[_loc3_] = [this.target[_loc3_]];
  505.                   }
  506.                   if(typeof _loc7_[_loc4_][_loc3_] == "number")
  507.                   {
  508.                      _loc6_[_loc3_].push(_loc7_[_loc4_][_loc3_]);
  509.                   }
  510.                   else
  511.                   {
  512.                      _loc6_[_loc3_].push(this.target[_loc3_] + Number(_loc7_[_loc4_][_loc3_]));
  513.                   }
  514.                }
  515.                _loc4_++;
  516.             }
  517.             for(_loc3_ in _loc6_)
  518.             {
  519.                if(typeof this.vars[_loc3_] == "number")
  520.                {
  521.                   _loc6_[_loc3_].push(this.vars[_loc3_]);
  522.                }
  523.                else
  524.                {
  525.                   _loc6_[_loc3_].push(this.target[_loc3_] + Number(this.vars[_loc3_]));
  526.                }
  527.                delete this.vars[_loc3_];
  528.             }
  529.             addSubTween(_loc8_,{"t":0},{"t":1},{
  530.                "props":parseBeziers(_loc6_,false),
  531.                "target":this.target,
  532.                "orientToBezier":this.vars.orientToBezier
  533.             });
  534.          }
  535.          if(this.vars.bezierThrough != undefined && this.vars.bezierThrough is Array)
  536.          {
  537.             _loc6_ = {};
  538.             _loc7_ = this.vars.bezierThrough;
  539.             _loc4_ = 0;
  540.             while(_loc4_ < _loc7_.length)
  541.             {
  542.                for(_loc3_ in _loc7_[_loc4_])
  543.                {
  544.                   if(_loc6_[_loc3_] == undefined)
  545.                   {
  546.                      _loc6_[_loc3_] = [this.target[_loc3_]];
  547.                   }
  548.                   if(typeof _loc7_[_loc4_][_loc3_] == "number")
  549.                   {
  550.                      _loc6_[_loc3_].push(_loc7_[_loc4_][_loc3_]);
  551.                   }
  552.                   else
  553.                   {
  554.                      _loc6_[_loc3_].push(this.target[_loc3_] + Number(_loc7_[_loc4_][_loc3_]));
  555.                   }
  556.                }
  557.                _loc4_++;
  558.             }
  559.             for(_loc3_ in _loc6_)
  560.             {
  561.                if(typeof this.vars[_loc3_] == "number")
  562.                {
  563.                   _loc6_[_loc3_].push(this.vars[_loc3_]);
  564.                }
  565.                else
  566.                {
  567.                   _loc6_[_loc3_].push(this.target[_loc3_] + Number(this.vars[_loc3_]));
  568.                }
  569.                delete this.vars[_loc3_];
  570.             }
  571.             addSubTween(_loc8_,{"t":0},{"t":1},{
  572.                "props":parseBeziers(_loc6_,true),
  573.                "target":this.target,
  574.                "orientToBezier":this.vars.orientToBezier
  575.             });
  576.          }
  577.          if(this.vars.hexColors != undefined && typeof this.vars.hexColors == "object")
  578.          {
  579.             for(_loc3_ in this.vars.hexColors)
  580.             {
  581.                addSubTween(hexColorsProxy,{
  582.                   "r":this.target[_loc3_] >> 16,
  583.                   "g":this.target[_loc3_] >> 8 & 0xFF,
  584.                   "b":this.target[_loc3_] & 0xFF
  585.                },{
  586.                   "r":this.vars.hexColors[_loc3_] >> 16,
  587.                   "g":this.vars.hexColors[_loc3_] >> 8 & 0xFF,
  588.                   "b":this.vars.hexColors[_loc3_] & 0xFF
  589.                },{
  590.                   "prop":_loc3_,
  591.                   "target":this.target
  592.                });
  593.             }
  594.          }
  595.          super.initTweenVals(true,param2);
  596.       }
  597.       
  598.       public function pause() : void
  599.       {
  600.          if(_pauseTime == -1)
  601.          {
  602.             _pauseTime = _curTime;
  603.             _active = false;
  604.          }
  605.       }
  606.       
  607.       public function resume() : void
  608.       {
  609.          var _loc1_:Number = NaN;
  610.          if(_pauseTime != -1)
  611.          {
  612.             _loc1_ = _curTime - _pauseTime;
  613.             this.initTime += _loc1_;
  614.             if(!isNaN(this.startTime))
  615.             {
  616.                this.startTime += _loc1_;
  617.             }
  618.             _pauseTime = -1;
  619.             if((_curTime - this.initTime) / 1000 > this.delay)
  620.             {
  621.                _active = true;
  622.             }
  623.          }
  624.       }
  625.       
  626.       protected function initDispatcher() : void
  627.       {
  628.          var _loc1_:Object = null;
  629.          var _loc2_:String = null;
  630.          if(_dispatcher == null)
  631.          {
  632.             _dispatcher = new EventDispatcher(this);
  633.             _callbacks = {
  634.                "onStart":this.vars.onStart,
  635.                "onUpdate":this.vars.onUpdate,
  636.                "onComplete":this.vars.onComplete
  637.             };
  638.             _loc1_ = {};
  639.             for(_loc2_ in this.vars)
  640.             {
  641.                _loc1_[_loc2_] = this.vars[_loc2_];
  642.             }
  643.             this.vars = _loc1_;
  644.             this.vars.onStart = onStartDispatcher;
  645.             this.vars.onUpdate = onUpdateDispatcher;
  646.             this.vars.onComplete = onCompleteDispatcher;
  647.             if(this.vars.onStartListener is Function)
  648.             {
  649.                _dispatcher.addEventListener(TweenEvent.START,this.vars.onStartListener,false,0,true);
  650.             }
  651.             if(this.vars.onUpdateListener is Function)
  652.             {
  653.                _dispatcher.addEventListener(TweenEvent.UPDATE,this.vars.onUpdateListener,false,0,true);
  654.             }
  655.             if(this.vars.onCompleteListener is Function)
  656.             {
  657.                _dispatcher.addEventListener(TweenEvent.COMPLETE,this.vars.onCompleteListener,false,0,true);
  658.             }
  659.          }
  660.       }
  661.       
  662.       protected function onStartDispatcher(... rest) : void
  663.       {
  664.          if(_callbacks.onStart != null)
  665.          {
  666.             _callbacks.onStart.apply(null,this.vars.onStartParams);
  667.          }
  668.          _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
  669.       }
  670.       
  671.       protected function onUpdateDispatcher(... rest) : void
  672.       {
  673.          if(_callbacks.onUpdate != null)
  674.          {
  675.             _callbacks.onUpdate.apply(null,this.vars.onUpdateParams);
  676.          }
  677.          _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
  678.       }
  679.       
  680.       protected function onCompleteDispatcher(... rest) : void
  681.       {
  682.          if(_callbacks.onComplete != null)
  683.          {
  684.             _callbacks.onComplete.apply(null,this.vars.onCompleteParams);
  685.          }
  686.          _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
  687.       }
  688.       
  689.       public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  690.       {
  691.          if(_dispatcher == null)
  692.          {
  693.             initDispatcher();
  694.          }
  695.          _dispatcher.addEventListener(param1,param2,param3,param4,param5);
  696.       }
  697.       
  698.       public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  699.       {
  700.          if(_dispatcher != null)
  701.          {
  702.             _dispatcher.removeEventListener(param1,param2,param3);
  703.          }
  704.       }
  705.       
  706.       public function hasEventListener(param1:String) : Boolean
  707.       {
  708.          if(_dispatcher == null)
  709.          {
  710.             return false;
  711.          }
  712.          return _dispatcher.hasEventListener(param1);
  713.       }
  714.       
  715.       public function willTrigger(param1:String) : Boolean
  716.       {
  717.          if(_dispatcher == null)
  718.          {
  719.             return false;
  720.          }
  721.          return _dispatcher.willTrigger(param1);
  722.       }
  723.       
  724.       public function dispatchEvent(param1:Event) : Boolean
  725.       {
  726.          if(_dispatcher == null)
  727.          {
  728.             return false;
  729.          }
  730.          return _dispatcher.dispatchEvent(param1);
  731.       }
  732.       
  733.       override public function get active() : Boolean
  734.       {
  735.          if(_active)
  736.          {
  737.             return true;
  738.          }
  739.          if(_pauseTime != -1)
  740.          {
  741.             return false;
  742.          }
  743.          if((_curTime - this.initTime) / 1000 > this.delay)
  744.          {
  745.             _active = true;
  746.             this.startTime = this.initTime + this.delay * 1000;
  747.             if(!_initted)
  748.             {
  749.                initTweenVals();
  750.             }
  751.             else if(this.vars.visible != undefined && _isDisplayObject)
  752.             {
  753.                this.target.visible = true;
  754.             }
  755.             if(this.vars.onStart != null)
  756.             {
  757.                this.vars.onStart.apply(null,this.vars.onStartParams);
  758.             }
  759.             if(this.duration == 0.001)
  760.             {
  761.                --this.startTime;
  762.             }
  763.             return true;
  764.          }
  765.          return false;
  766.       }
  767.       
  768.       public function get paused() : Boolean
  769.       {
  770.          if(_pauseTime != -1)
  771.          {
  772.             return true;
  773.          }
  774.          return false;
  775.       }
  776.       
  777.       public function set paused(param1:Boolean) : void
  778.       {
  779.          if(param1)
  780.          {
  781.             this.pause();
  782.          }
  783.          else
  784.          {
  785.             this.resume();
  786.          }
  787.       }
  788.       
  789.       public function get progress() : Number
  790.       {
  791.          var _loc1_:Number = Number((_curTime - this.startTime) / 1000 / this.duration || 0);
  792.          if(_loc1_ > 1)
  793.          {
  794.             return 1;
  795.          }
  796.          return _loc1_;
  797.       }
  798.       
  799.       public function set progress(param1:Number) : void
  800.       {
  801.          var _loc2_:Number = _curTime - this.duration * param1 * 1000;
  802.          this.initTime = _loc2_ - this.delay * 1000;
  803.          var _loc3_:Boolean = this.active;
  804.          this.startTime = _loc2_;
  805.          render(_curTime);
  806.          var _loc4_:* = this.vars.visible;
  807.          if(this.vars.isTV == true)
  808.          {
  809.             _loc4_ = this.vars.exposedProps.visible;
  810.          }
  811.          if(_loc4_ != null && _isDisplayObject && param1 < 1)
  812.          {
  813.             this.target.visible = Boolean(_loc4_);
  814.          }
  815.       }
  816.    }
  817. }
  818.  
  819.