home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / com / greensock / TweenMax.as < prev   
Encoding:
Text File  |  2010-11-30  |  30.8 KB  |  912 lines

  1. package com.greensock
  2. {
  3.    import com.greensock.core.*;
  4.    import com.greensock.events.TweenEvent;
  5.    import com.greensock.plugins.*;
  6.    import flash.display.*;
  7.    import flash.events.*;
  8.    import flash.utils.*;
  9.    
  10.    public class TweenMax extends TweenLite implements IEventDispatcher
  11.    {
  12.       public static const version:Number = 11.37;
  13.       
  14.       private static var _overwriteMode:int = OverwriteManager.enabled ? OverwriteManager.mode : OverwriteManager.init(2);
  15.       
  16.       public static var killTweensOf:Function = TweenLite.killTweensOf;
  17.       
  18.       public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
  19.       
  20.       TweenPlugin.activate([AutoAlphaPlugin,EndArrayPlugin,FramePlugin,RemoveTintPlugin,TintPlugin,VisiblePlugin,VolumePlugin,BevelFilterPlugin,BezierPlugin,BezierThroughPlugin,BlurFilterPlugin,ColorMatrixFilterPlugin,ColorTransformPlugin,DropShadowFilterPlugin,FrameLabelPlugin,GlowFilterPlugin,HexColorsPlugin,RoundPropsPlugin,ShortRotationPlugin,{}]);
  21.       
  22.       protected var _dispatcher:EventDispatcher;
  23.       
  24.       protected var _hasUpdateListener:Boolean;
  25.       
  26.       protected var _repeat:int = 0;
  27.       
  28.       protected var _repeatDelay:Number = 0;
  29.       
  30.       protected var _cyclesComplete:uint = 0;
  31.       
  32.       protected var _easePower:uint;
  33.       
  34.       protected var _easeType:uint;
  35.       
  36.       public var yoyo:Boolean;
  37.       
  38.       public function TweenMax(param1:Object, param2:Number, param3:Object)
  39.       {
  40.          super(param1,param2,param3);
  41.          if(TweenLite.version < 11.2)
  42.          {
  43.             throw new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
  44.          }
  45.          this.yoyo = Boolean(this.vars.yoyo);
  46.          this._repeat = !!this.vars.repeat ? int(this.vars.repeat) : 0;
  47.          this._repeatDelay = !!this.vars.repeatDelay ? Number(this.vars.repeatDelay) : 0;
  48.          this.cacheIsDirty = true;
  49.          if(Boolean(this.vars.onCompleteListener) || Boolean(this.vars.onInitListener) || Boolean(this.vars.onUpdateListener) || Boolean(this.vars.onStartListener) || Boolean(this.vars.onRepeatListener) || Boolean(this.vars.onReverseCompleteListener))
  50.          {
  51.             this.initDispatcher();
  52.             if(param2 == 0 && _delay == 0)
  53.             {
  54.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
  55.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
  56.             }
  57.          }
  58.          if(Boolean(this.vars.timeScale) && !(this.target is TweenCore))
  59.          {
  60.             this.cachedTimeScale = this.vars.timeScale;
  61.          }
  62.       }
  63.       
  64.       public static function to(param1:Object, param2:Number, param3:Object) : TweenMax
  65.       {
  66.          return new TweenMax(param1,param2,param3);
  67.       }
  68.       
  69.       public static function from(param1:Object, param2:Number, param3:Object) : TweenMax
  70.       {
  71.          param3.runBackwards = true;
  72.          if(!("immediateRender" in param3))
  73.          {
  74.             param3.immediateRender = true;
  75.          }
  76.          return new TweenMax(param1,param2,param3);
  77.       }
  78.       
  79.       public static function fromTo(param1:Object, param2:Number, param3:Object, param4:Object) : TweenMax
  80.       {
  81.          param4.startAt = param3;
  82.          if(param3.immediateRender)
  83.          {
  84.             param4.immediateRender = true;
  85.          }
  86.          return new TweenMax(param1,param2,param4);
  87.       }
  88.       
  89.       public static function allTo(param1:Array, param2:Number, param3:Object, param4:Number = 0, param5:Function = null, param6:Array = null) : Array
  90.       {
  91.          var i:int = 0;
  92.          var varsDup:Object = null;
  93.          var p:String = null;
  94.          var onCompleteProxy:Function = null;
  95.          var onCompleteParamsProxy:Array = null;
  96.          var targets:Array = param1;
  97.          var duration:Number = param2;
  98.          var vars:Object = param3;
  99.          var stagger:Number = param4;
  100.          var onCompleteAll:Function = param5;
  101.          var onCompleteAllParams:Array = param6;
  102.          var l:uint = targets.length;
  103.          var a:Array = [];
  104.          var curDelay:Number = "delay" in vars ? Number(vars.delay) : 0;
  105.          onCompleteProxy = vars.onComplete;
  106.          onCompleteParamsProxy = vars.onCompleteParams;
  107.          var lastIndex:int = stagger <= 0 ? 0 : int(l - 1);
  108.          i = 0;
  109.          while(i < l)
  110.          {
  111.             varsDup = {};
  112.             for(p in vars)
  113.             {
  114.                varsDup[p] = vars[p];
  115.             }
  116.             varsDup.delay = curDelay;
  117.             if(i == lastIndex && onCompleteAll != null)
  118.             {
  119.                varsDup.onComplete = function():void
  120.                {
  121.                   if(onCompleteProxy != null)
  122.                   {
  123.                      onCompleteProxy.apply(null,onCompleteParamsProxy);
  124.                   }
  125.                   onCompleteAll.apply(null,onCompleteAllParams);
  126.                };
  127.             }
  128.             a[a.length] = new TweenMax(targets[i],duration,varsDup);
  129.             curDelay += stagger;
  130.             i++;
  131.          }
  132.          return a;
  133.       }
  134.       
  135.       public static function allFrom(param1:Array, param2:Number, param3:Object, param4:Number = 0, param5:Function = null, param6:Array = null) : Array
  136.       {
  137.          param3.runBackwards = true;
  138.          if(!("immediateRender" in param3))
  139.          {
  140.             param3.immediateRender = true;
  141.          }
  142.          return allTo(param1,param2,param3,param4,param5,param6);
  143.       }
  144.       
  145.       public static function allFromTo(param1:Array, param2:Number, param3:Object, param4:Object, param5:Number = 0, param6:Function = null, param7:Array = null) : Array
  146.       {
  147.          param4.startAt = param3;
  148.          if(param3.immediateRender)
  149.          {
  150.             param4.immediateRender = true;
  151.          }
  152.          return allTo(param1,param2,param4,param5,param6,param7);
  153.       }
  154.       
  155.       public static function delayedCall(param1:Number, param2:Function, param3:Array = null, param4:Boolean = false) : TweenMax
  156.       {
  157.          return new TweenMax(param2,0,{
  158.             "delay":param1,
  159.             "onComplete":param2,
  160.             "onCompleteParams":param3,
  161.             "immediateRender":false,
  162.             "useFrames":param4,
  163.             "overwrite":0
  164.          });
  165.       }
  166.       
  167.       public static function getTweensOf(param1:Object) : Array
  168.       {
  169.          var _loc4_:int = 0;
  170.          var _loc5_:uint = 0;
  171.          var _loc2_:Array = masterList[param1];
  172.          var _loc3_:Array = [];
  173.          if(_loc2_)
  174.          {
  175.             _loc4_ = int(_loc2_.length);
  176.             _loc5_ = 0;
  177.             while(--_loc4_ > -1)
  178.             {
  179.                if(!_loc2_[_loc4_].gc)
  180.                {
  181.                   var _loc6_:*;
  182.                   _loc3_[_loc6_ = _loc5_++] = _loc2_[_loc4_];
  183.                }
  184.             }
  185.          }
  186.          return _loc3_;
  187.       }
  188.       
  189.       public static function isTweening(param1:Object) : Boolean
  190.       {
  191.          var _loc4_:TweenLite = null;
  192.          var _loc2_:Array = getTweensOf(param1);
  193.          var _loc3_:int = int(_loc2_.length);
  194.          while(--_loc3_ > -1)
  195.          {
  196.             _loc4_ = _loc2_[_loc3_];
  197.             if(_loc4_.active || _loc4_.cachedStartTime == _loc4_.timeline.cachedTime && _loc4_.timeline.active)
  198.             {
  199.                return true;
  200.             }
  201.          }
  202.          return false;
  203.       }
  204.       
  205.       public static function getAllTweens() : Array
  206.       {
  207.          var _loc4_:Array = null;
  208.          var _loc5_:int = 0;
  209.          var _loc1_:Dictionary = masterList;
  210.          var _loc2_:uint = 0;
  211.          var _loc3_:Array = [];
  212.          for each(_loc4_ in _loc1_)
  213.          {
  214.             _loc5_ = int(_loc4_.length);
  215.             while(--_loc5_ > -1)
  216.             {
  217.                if(!TweenLite(_loc4_[_loc5_]).gc)
  218.                {
  219.                   var _loc8_:*;
  220.                   _loc3_[_loc8_ = _loc2_++] = _loc4_[_loc5_];
  221.                }
  222.             }
  223.          }
  224.          return _loc3_;
  225.       }
  226.       
  227.       public static function killAll(param1:Boolean = false, param2:Boolean = true, param3:Boolean = true) : void
  228.       {
  229.          var _loc5_:* = false;
  230.          var _loc4_:Array = getAllTweens();
  231.          var _loc6_:int = int(_loc4_.length);
  232.          while(--_loc6_ > -1)
  233.          {
  234.             _loc5_ = _loc4_[_loc6_].target == _loc4_[_loc6_].vars.onComplete;
  235.             if(_loc5_ == param3 || _loc5_ != param2)
  236.             {
  237.                if(param1)
  238.                {
  239.                   _loc4_[_loc6_].complete(false);
  240.                }
  241.                else
  242.                {
  243.                   _loc4_[_loc6_].setEnabled(false,false);
  244.                }
  245.             }
  246.          }
  247.       }
  248.       
  249.       public static function killChildTweensOf(param1:DisplayObjectContainer, param2:Boolean = false) : void
  250.       {
  251.          var _loc4_:Object = null;
  252.          var _loc5_:DisplayObjectContainer = null;
  253.          var _loc3_:Array = getAllTweens();
  254.          var _loc6_:int = int(_loc3_.length);
  255.          while(--_loc6_ > -1)
  256.          {
  257.             _loc4_ = _loc3_[_loc6_].target;
  258.             if(_loc4_ is DisplayObject)
  259.             {
  260.                _loc5_ = _loc4_.parent;
  261.                while(_loc5_)
  262.                {
  263.                   if(_loc5_ == param1)
  264.                   {
  265.                      if(param2)
  266.                      {
  267.                         _loc3_[_loc6_].complete(false);
  268.                      }
  269.                      else
  270.                      {
  271.                         _loc3_[_loc6_].setEnabled(false,false);
  272.                      }
  273.                   }
  274.                   _loc5_ = _loc5_.parent;
  275.                }
  276.             }
  277.          }
  278.       }
  279.       
  280.       public static function pauseAll(param1:Boolean = true, param2:Boolean = true) : void
  281.       {
  282.          changePause(true,param1,param2);
  283.       }
  284.       
  285.       public static function resumeAll(param1:Boolean = true, param2:Boolean = true) : void
  286.       {
  287.          changePause(false,param1,param2);
  288.       }
  289.       
  290.       private static function changePause(param1:Boolean, param2:Boolean = true, param3:Boolean = false) : void
  291.       {
  292.          var _loc5_:* = false;
  293.          var _loc4_:Array = getAllTweens();
  294.          var _loc6_:int = int(_loc4_.length);
  295.          while(--_loc6_ > -1)
  296.          {
  297.             _loc5_ = TweenLite(_loc4_[_loc6_]).target == TweenLite(_loc4_[_loc6_]).vars.onComplete;
  298.             if(_loc5_ == param3 || _loc5_ != param2)
  299.             {
  300.                TweenCore(_loc4_[_loc6_]).paused = param1;
  301.             }
  302.          }
  303.       }
  304.       
  305.       public static function get globalTimeScale() : Number
  306.       {
  307.          return TweenLite.rootTimeline == null ? 1 : TweenLite.rootTimeline.cachedTimeScale;
  308.       }
  309.       
  310.       public static function set globalTimeScale(param1:Number) : void
  311.       {
  312.          if(param1 == 0)
  313.          {
  314.             param1 = 0.0001;
  315.          }
  316.          if(TweenLite.rootTimeline == null)
  317.          {
  318.             TweenLite.to({},0,{});
  319.          }
  320.          var _loc2_:SimpleTimeline = TweenLite.rootTimeline;
  321.          var _loc3_:Number = getTimer() * 0.001;
  322.          _loc2_.cachedStartTime = _loc3_ - (_loc3_ - _loc2_.cachedStartTime) * _loc2_.cachedTimeScale / param1;
  323.          _loc2_ = TweenLite.rootFramesTimeline;
  324.          _loc3_ = TweenLite.rootFrame;
  325.          _loc2_.cachedStartTime = _loc3_ - (_loc3_ - _loc2_.cachedStartTime) * _loc2_.cachedTimeScale / param1;
  326.          TweenLite.rootFramesTimeline.cachedTimeScale = TweenLite.rootTimeline.cachedTimeScale = param1;
  327.       }
  328.       
  329.       override protected function init() : void
  330.       {
  331.          var _loc1_:TweenMax = null;
  332.          var _loc2_:int = 0;
  333.          var _loc3_:String = null;
  334.          var _loc4_:* = null;
  335.          var _loc5_:Array = null;
  336.          var _loc6_:Object = null;
  337.          var _loc7_:PropTween = null;
  338.          var _loc8_:PropTween = null;
  339.          var _loc9_:int = 0;
  340.          if(this.vars.startAt)
  341.          {
  342.             this.vars.startAt.overwrite = 0;
  343.             this.vars.startAt.immediateRender = true;
  344.             _loc1_ = new TweenMax(this.target,0,this.vars.startAt);
  345.          }
  346.          if(this._dispatcher)
  347.          {
  348.             this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.INIT));
  349.          }
  350.          super.init();
  351.          if(_ease in fastEaseLookup)
  352.          {
  353.             this._easeType = fastEaseLookup[_ease][0];
  354.             this._easePower = fastEaseLookup[_ease][1];
  355.          }
  356.          if(this.vars.roundProps != null && "roundProps" in TweenLite.plugins)
  357.          {
  358.             _loc5_ = this.vars.roundProps;
  359.             _loc9_ = int(_loc5_.length);
  360.             while(--_loc9_ > -1)
  361.             {
  362.                _loc3_ = _loc5_[_loc9_];
  363.                _loc8_ = this.cachedPT1;
  364.                while(_loc8_)
  365.                {
  366.                   if(_loc8_.name == _loc3_)
  367.                   {
  368.                      if(_loc8_.isPlugin)
  369.                      {
  370.                         _loc8_.target.round = true;
  371.                      }
  372.                      else
  373.                      {
  374.                         if(_loc6_ == null)
  375.                         {
  376.                            _loc6_ = new TweenLite.plugins.roundProps();
  377.                            _loc6_.add(_loc8_.target,_loc3_,_loc8_.start,_loc8_.change);
  378.                            _hasPlugins = true;
  379.                            this.cachedPT1 = _loc7_ = this.insertPropTween(_loc6_,"changeFactor",0,1,"_MULTIPLE_",true,this.cachedPT1);
  380.                         }
  381.                         else
  382.                         {
  383.                            _loc6_.add(_loc8_.target,_loc3_,_loc8_.start,_loc8_.change);
  384.                         }
  385.                         this.removePropTween(_loc8_);
  386.                         this.propTweenLookup[_loc3_] = _loc7_;
  387.                      }
  388.                   }
  389.                   else if(_loc8_.isPlugin && _loc8_.name == "_MULTIPLE_" && !_loc8_.target.round)
  390.                   {
  391.                      _loc4_ = " " + _loc8_.target.overwriteProps.join(" ") + " ";
  392.                      if(_loc4_.indexOf(" " + _loc3_ + " ") != -1)
  393.                      {
  394.                         _loc8_.target.round = true;
  395.                      }
  396.                   }
  397.                   _loc8_ = _loc8_.nextNode;
  398.                }
  399.             }
  400.          }
  401.       }
  402.       
  403.       protected function insertPropTween(param1:Object, param2:String, param3:Number, param4:*, param5:String, param6:Boolean, param7:PropTween) : PropTween
  404.       {
  405.          var _loc9_:Array = null;
  406.          var _loc10_:int = 0;
  407.          var _loc8_:PropTween = new PropTween(param1,param2,param3,typeof param4 == "number" ? param4 - param3 : Number(param4),param5,param6,param7);
  408.          if(param6 && param5 == "_MULTIPLE_")
  409.          {
  410.             _loc9_ = param1.overwriteProps;
  411.             _loc10_ = int(_loc9_.length);
  412.             while(--_loc10_ > -1)
  413.             {
  414.                this.propTweenLookup[_loc9_[_loc10_]] = _loc8_;
  415.             }
  416.          }
  417.          else
  418.          {
  419.             this.propTweenLookup[param5] = _loc8_;
  420.          }
  421.          return _loc8_;
  422.       }
  423.       
  424.       protected function removePropTween(param1:PropTween) : Boolean
  425.       {
  426.          if(param1.nextNode)
  427.          {
  428.             param1.nextNode.prevNode = param1.prevNode;
  429.          }
  430.          if(param1.prevNode)
  431.          {
  432.             param1.prevNode.nextNode = param1.nextNode;
  433.          }
  434.          else if(this.cachedPT1 == param1)
  435.          {
  436.             this.cachedPT1 = param1.nextNode;
  437.          }
  438.          if(param1.isPlugin && Boolean(param1.target.onDisable))
  439.          {
  440.             param1.target.onDisable();
  441.             if(param1.target.activeDisable)
  442.             {
  443.                return true;
  444.             }
  445.          }
  446.          return false;
  447.       }
  448.       
  449.       override public function invalidate() : void
  450.       {
  451.          this.yoyo = Boolean(this.vars.yoyo == true);
  452.          this._repeat = !!this.vars.repeat ? int(Number(this.vars.repeat)) : 0;
  453.          this._repeatDelay = !!this.vars.repeatDelay ? Number(this.vars.repeatDelay) : 0;
  454.          this._hasUpdateListener = false;
  455.          if(this.vars.onCompleteListener != null || this.vars.onUpdateListener != null || this.vars.onStartListener != null)
  456.          {
  457.             this.initDispatcher();
  458.          }
  459.          setDirtyCache(true);
  460.          super.invalidate();
  461.       }
  462.       
  463.       public function updateTo(param1:Object, param2:Boolean = false) : void
  464.       {
  465.          var _loc4_:String = null;
  466.          var _loc5_:Number = NaN;
  467.          var _loc6_:PropTween = null;
  468.          var _loc7_:Number = NaN;
  469.          var _loc3_:Number = this.ratio;
  470.          if(param2 && this.timeline != null && this.cachedStartTime < this.timeline.cachedTime)
  471.          {
  472.             this.cachedStartTime = this.timeline.cachedTime;
  473.             this.setDirtyCache(false);
  474.             if(this.gc)
  475.             {
  476.                this.setEnabled(true,false);
  477.             }
  478.             else
  479.             {
  480.                this.timeline.addChild(this);
  481.             }
  482.          }
  483.          for(_loc4_ in param1)
  484.          {
  485.             this.vars[_loc4_] = param1[_loc4_];
  486.          }
  487.          if(this.initted)
  488.          {
  489.             this.initted = false;
  490.             if(!param2)
  491.             {
  492.                this.init();
  493.                if(!param2 && this.cachedTime > 0 && this.cachedTime < this.cachedDuration)
  494.                {
  495.                   _loc5_ = 1 / (1 - _loc3_);
  496.                   _loc6_ = this.cachedPT1;
  497.                   while(_loc6_)
  498.                   {
  499.                      _loc7_ = _loc6_.start + _loc6_.change;
  500.                      _loc6_.change *= _loc5_;
  501.                      _loc6_.start = _loc7_ - _loc6_.change;
  502.                      _loc6_ = _loc6_.nextNode;
  503.                   }
  504.                }
  505.             }
  506.          }
  507.       }
  508.       
  509.       public function setDestination(param1:String, param2:*, param3:Boolean = true) : void
  510.       {
  511.          var _loc4_:Object = {};
  512.          _loc4_[param1] = param2;
  513.          this.updateTo(_loc4_,!param3);
  514.       }
  515.       
  516.       public function killProperties(param1:Array) : void
  517.       {
  518.          var _loc2_:Object = {};
  519.          var _loc3_:int = int(param1.length);
  520.          while(--_loc3_ > -1)
  521.          {
  522.             _loc2_[param1[_loc3_]] = true;
  523.          }
  524.          killVars(_loc2_);
  525.       }
  526.       
  527.       override public function renderTime(param1:Number, param2:Boolean = false, param3:Boolean = false) : void
  528.       {
  529.          var _loc6_:Boolean = false;
  530.          var _loc7_:Boolean = false;
  531.          var _loc8_:Boolean = false;
  532.          var _loc10_:Number = NaN;
  533.          var _loc11_:int = 0;
  534.          var _loc12_:int = 0;
  535.          var _loc13_:Number = NaN;
  536.          var _loc4_:Number = this.cacheIsDirty ? this.totalDuration : this.cachedTotalDuration;
  537.          var _loc5_:Number = this.cachedTime;
  538.          if(param1 >= _loc4_)
  539.          {
  540.             this.cachedTotalTime = _loc4_;
  541.             this.cachedTime = this.cachedDuration;
  542.             this.ratio = 1;
  543.             _loc6_ = true;
  544.             if(this.cachedDuration == 0)
  545.             {
  546.                if((param1 == 0 || _rawPrevTime < 0) && _rawPrevTime != param1)
  547.                {
  548.                   param3 = true;
  549.                }
  550.                _rawPrevTime = param1;
  551.             }
  552.          }
  553.          else if(param1 <= 0)
  554.          {
  555.             if(param1 < 0)
  556.             {
  557.                this.active = false;
  558.                if(this.cachedDuration == 0)
  559.                {
  560.                   if(_rawPrevTime > 0)
  561.                   {
  562.                      param3 = true;
  563.                      _loc6_ = true;
  564.                   }
  565.                   _rawPrevTime = param1;
  566.                }
  567.             }
  568.             this.cachedTotalTime = this.cachedTime = this.ratio = 0;
  569.             if(this.cachedReversed && _loc5_ != 0)
  570.             {
  571.                _loc6_ = true;
  572.             }
  573.          }
  574.          else
  575.          {
  576.             this.cachedTotalTime = this.cachedTime = param1;
  577.             _loc8_ = true;
  578.          }
  579.          if(this._repeat != 0)
  580.          {
  581.             _loc10_ = this.cachedDuration + this._repeatDelay;
  582.             if(_loc6_)
  583.             {
  584.                if(this.yoyo && Boolean(this._repeat % 2))
  585.                {
  586.                   this.cachedTime = this.ratio = 0;
  587.                }
  588.             }
  589.             else if(param1 > 0)
  590.             {
  591.                _loc11_ = int(this._cyclesComplete);
  592.                this._cyclesComplete = int(this.cachedTotalTime / _loc10_);
  593.                if(this._cyclesComplete == this.cachedTotalTime / _loc10_)
  594.                {
  595.                   --this._cyclesComplete;
  596.                }
  597.                if(_loc11_ != this._cyclesComplete)
  598.                {
  599.                   _loc7_ = true;
  600.                }
  601.                this.cachedTime = (this.cachedTotalTime / _loc10_ - this._cyclesComplete) * _loc10_;
  602.                if(this.yoyo && Boolean(this._cyclesComplete % 2))
  603.                {
  604.                   this.cachedTime = this.cachedDuration - this.cachedTime;
  605.                }
  606.                else if(this.cachedTime >= this.cachedDuration)
  607.                {
  608.                   this.cachedTime = this.cachedDuration;
  609.                   this.ratio = 1;
  610.                   _loc8_ = false;
  611.                }
  612.                if(this.cachedTime <= 0)
  613.                {
  614.                   this.cachedTime = this.ratio = 0;
  615.                   _loc8_ = false;
  616.                }
  617.             }
  618.          }
  619.          if(_loc5_ == this.cachedTime && !param3)
  620.          {
  621.             return;
  622.          }
  623.          if(!this.initted)
  624.          {
  625.             this.init();
  626.          }
  627.          if(!this.active && !this.cachedPaused)
  628.          {
  629.             this.active = true;
  630.          }
  631.          if(_loc8_)
  632.          {
  633.             if(this._easeType)
  634.             {
  635.                _loc12_ = int(this._easePower);
  636.                _loc13_ = this.cachedTime / this.cachedDuration;
  637.                if(this._easeType == 2)
  638.                {
  639.                   this.ratio = _loc13_ = 1 - _loc13_;
  640.                   while(--_loc12_ > -1)
  641.                   {
  642.                      this.ratio = _loc13_ * this.ratio;
  643.                   }
  644.                   this.ratio = 1 - this.ratio;
  645.                }
  646.                else if(this._easeType == 1)
  647.                {
  648.                   this.ratio = _loc13_;
  649.                   while(--_loc12_ > -1)
  650.                   {
  651.                      this.ratio = _loc13_ * this.ratio;
  652.                   }
  653.                }
  654.                else if(_loc13_ < 0.5)
  655.                {
  656.                   this.ratio = _loc13_ = _loc13_ * 2;
  657.                   while(--_loc12_ > -1)
  658.                   {
  659.                      this.ratio = _loc13_ * this.ratio;
  660.                   }
  661.                   this.ratio *= 0.5;
  662.                }
  663.                else
  664.                {
  665.                   this.ratio = _loc13_ = (1 - _loc13_) * 2;
  666.                   while(--_loc12_ > -1)
  667.                   {
  668.                      this.ratio = _loc13_ * this.ratio;
  669.                   }
  670.                   this.ratio = 1 - 0.5 * this.ratio;
  671.                }
  672.             }
  673.             else
  674.             {
  675.                this.ratio = _ease(this.cachedTime,0,1,this.cachedDuration);
  676.             }
  677.          }
  678.          if(_loc5_ == 0 && this.cachedTotalTime != 0 && !param2)
  679.          {
  680.             if(this.vars.onStart)
  681.             {
  682.                this.vars.onStart.apply(null,this.vars.onStartParams);
  683.             }
  684.             if(this._dispatcher)
  685.             {
  686.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
  687.             }
  688.          }
  689.          var _loc9_:PropTween = this.cachedPT1;
  690.          while(_loc9_)
  691.          {
  692.             _loc9_.target[_loc9_.property] = _loc9_.start + this.ratio * _loc9_.change;
  693.             _loc9_ = _loc9_.nextNode;
  694.          }
  695.          if(_hasUpdate && !param2)
  696.          {
  697.             this.vars.onUpdate.apply(null,this.vars.onUpdateParams);
  698.          }
  699.          if(this._hasUpdateListener && !param2)
  700.          {
  701.             this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
  702.          }
  703.          if(_loc6_)
  704.          {
  705.             if(_hasPlugins && Boolean(this.cachedPT1))
  706.             {
  707.                onPluginEvent("onComplete",this);
  708.             }
  709.             this.complete(true,param2);
  710.          }
  711.          else if(_loc7_ && !param2)
  712.          {
  713.             if(this.vars.onRepeat)
  714.             {
  715.                this.vars.onRepeat.apply(null,this.vars.onRepeatParams);
  716.             }
  717.             if(this._dispatcher)
  718.             {
  719.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
  720.             }
  721.          }
  722.       }
  723.       
  724.       override public function complete(param1:Boolean = false, param2:Boolean = false) : void
  725.       {
  726.          super.complete(param1,param2);
  727.          if(!param2 && Boolean(this._dispatcher))
  728.          {
  729.             if(this.cachedTotalTime == this.cachedTotalDuration && !this.cachedReversed)
  730.             {
  731.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
  732.             }
  733.             else if(this.cachedReversed && this.cachedTotalTime == 0)
  734.             {
  735.                this._dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
  736.             }
  737.          }
  738.       }
  739.       
  740.       protected function initDispatcher() : void
  741.       {
  742.          if(this._dispatcher == null)
  743.          {
  744.             this._dispatcher = new EventDispatcher(this);
  745.          }
  746.          if(this.vars.onInitListener is Function)
  747.          {
  748.             this._dispatcher.addEventListener(TweenEvent.INIT,this.vars.onInitListener,false,0,true);
  749.          }
  750.          if(this.vars.onStartListener is Function)
  751.          {
  752.             this._dispatcher.addEventListener(TweenEvent.START,this.vars.onStartListener,false,0,true);
  753.          }
  754.          if(this.vars.onUpdateListener is Function)
  755.          {
  756.             this._dispatcher.addEventListener(TweenEvent.UPDATE,this.vars.onUpdateListener,false,0,true);
  757.             this._hasUpdateListener = true;
  758.          }
  759.          if(this.vars.onCompleteListener is Function)
  760.          {
  761.             this._dispatcher.addEventListener(TweenEvent.COMPLETE,this.vars.onCompleteListener,false,0,true);
  762.          }
  763.          if(this.vars.onRepeatListener is Function)
  764.          {
  765.             this._dispatcher.addEventListener(TweenEvent.REPEAT,this.vars.onRepeatListener,false,0,true);
  766.          }
  767.          if(this.vars.onReverseCompleteListener is Function)
  768.          {
  769.             this._dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE,this.vars.onReverseCompleteListener,false,0,true);
  770.          }
  771.       }
  772.       
  773.       public function addEventListener(param1:String, param2:Function, param3:Boolean = false, param4:int = 0, param5:Boolean = false) : void
  774.       {
  775.          if(this._dispatcher == null)
  776.          {
  777.             this.initDispatcher();
  778.          }
  779.          if(param1 == TweenEvent.UPDATE)
  780.          {
  781.             this._hasUpdateListener = true;
  782.          }
  783.          this._dispatcher.addEventListener(param1,param2,param3,param4,param5);
  784.       }
  785.       
  786.       public function removeEventListener(param1:String, param2:Function, param3:Boolean = false) : void
  787.       {
  788.          if(this._dispatcher)
  789.          {
  790.             this._dispatcher.removeEventListener(param1,param2,param3);
  791.          }
  792.       }
  793.       
  794.       public function hasEventListener(param1:String) : Boolean
  795.       {
  796.          return this._dispatcher == null ? false : this._dispatcher.hasEventListener(param1);
  797.       }
  798.       
  799.       public function willTrigger(param1:String) : Boolean
  800.       {
  801.          return this._dispatcher == null ? false : this._dispatcher.willTrigger(param1);
  802.       }
  803.       
  804.       public function dispatchEvent(param1:Event) : Boolean
  805.       {
  806.          return this._dispatcher == null ? false : this._dispatcher.dispatchEvent(param1);
  807.       }
  808.       
  809.       public function get currentProgress() : Number
  810.       {
  811.          return this.cachedTime / this.duration;
  812.       }
  813.       
  814.       public function set currentProgress(param1:Number) : void
  815.       {
  816.          if(this._cyclesComplete == 0)
  817.          {
  818.             setTotalTime(this.duration * param1,false);
  819.          }
  820.          else
  821.          {
  822.             setTotalTime(this.duration * param1 + this._cyclesComplete * this.cachedDuration,false);
  823.          }
  824.       }
  825.       
  826.       public function get totalProgress() : Number
  827.       {
  828.          return this.cachedTotalTime / this.totalDuration;
  829.       }
  830.       
  831.       public function set totalProgress(param1:Number) : void
  832.       {
  833.          setTotalTime(this.totalDuration * param1,false);
  834.       }
  835.       
  836.       override public function set currentTime(param1:Number) : void
  837.       {
  838.          if(this._cyclesComplete != 0)
  839.          {
  840.             if(this.yoyo && this._cyclesComplete % 2 == 1)
  841.             {
  842.                param1 = this.duration - param1 + this._cyclesComplete * (this.cachedDuration + this._repeatDelay);
  843.             }
  844.             else
  845.             {
  846.                param1 += this._cyclesComplete * (this.duration + this._repeatDelay);
  847.             }
  848.          }
  849.          setTotalTime(param1,false);
  850.       }
  851.       
  852.       override public function get totalDuration() : Number
  853.       {
  854.          if(this.cacheIsDirty)
  855.          {
  856.             this.cachedTotalDuration = this._repeat == -1 ? 999999999999 : this.cachedDuration * (this._repeat + 1) + this._repeatDelay * this._repeat;
  857.             this.cacheIsDirty = false;
  858.          }
  859.          return this.cachedTotalDuration;
  860.       }
  861.       
  862.       override public function set totalDuration(param1:Number) : void
  863.       {
  864.          if(this._repeat == -1)
  865.          {
  866.             return;
  867.          }
  868.          this.duration = (param1 - this._repeat * this._repeatDelay) / (this._repeat + 1);
  869.       }
  870.       
  871.       public function get timeScale() : Number
  872.       {
  873.          return this.cachedTimeScale;
  874.       }
  875.       
  876.       public function set timeScale(param1:Number) : void
  877.       {
  878.          if(param1 == 0)
  879.          {
  880.             param1 = 0.0001;
  881.          }
  882.          var _loc2_:Number = Boolean(_pauseTime) || _pauseTime == 0 ? _pauseTime : this.timeline.cachedTotalTime;
  883.          this.cachedStartTime = _loc2_ - (_loc2_ - this.cachedStartTime) * this.cachedTimeScale / param1;
  884.          this.cachedTimeScale = param1;
  885.          setDirtyCache(false);
  886.       }
  887.       
  888.       public function get repeat() : int
  889.       {
  890.          return this._repeat;
  891.       }
  892.       
  893.       public function set repeat(param1:int) : void
  894.       {
  895.          this._repeat = param1;
  896.          setDirtyCache(true);
  897.       }
  898.       
  899.       public function get repeatDelay() : Number
  900.       {
  901.          return this._repeatDelay;
  902.       }
  903.       
  904.       public function set repeatDelay(param1:Number) : void
  905.       {
  906.          this._repeatDelay = param1;
  907.          setDirtyCache(true);
  908.       }
  909.    }
  910. }
  911.  
  912.