home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2012 January / ME_2012_01.iso / Galileo-Video / system / ChromeLinux.swf / scripts / com / greensock / plugins / ShortRotationPlugin.as < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.3 KB  |  43 lines

  1. package com.greensock.plugins
  2. {
  3.    import com.greensock.*;
  4.    
  5.    public class ShortRotationPlugin extends TweenPlugin
  6.    {
  7.       public static const API:Number = 1;
  8.       
  9.       public function ShortRotationPlugin()
  10.       {
  11.          super();
  12.          this.propName = "shortRotation";
  13.          this.overwriteProps = [];
  14.       }
  15.       
  16.       override public function onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
  17.       {
  18.          var _loc4_:String = null;
  19.          if(typeof param2 == "number")
  20.          {
  21.             return false;
  22.          }
  23.          for(_loc4_ in param2)
  24.          {
  25.             initRotation(param1,_loc4_,param1[_loc4_],typeof param2[_loc4_] == "number" ? Number(param2[_loc4_]) : param1[_loc4_] + Number(param2[_loc4_]));
  26.          }
  27.          return true;
  28.       }
  29.       
  30.       public function initRotation(param1:Object, param2:String, param3:Number, param4:Number) : void
  31.       {
  32.          var _loc5_:Number = (param4 - param3) % 360;
  33.          if(_loc5_ != _loc5_ % 180)
  34.          {
  35.             _loc5_ = _loc5_ < 0 ? _loc5_ + 360 : _loc5_ - 360;
  36.          }
  37.          addTween(param1,param2,param3,param3 + _loc5_,param2);
  38.          this.overwriteProps[this.overwriteProps.length] = param2;
  39.       }
  40.    }
  41. }
  42.  
  43.