home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / table_so.swf / scripts / __Packages / mx / transitions / easing / Bounce.as next >
Encoding:
Text File  |  2007-03-21  |  980 b   |  36 lines

  1. class mx.transitions.easing.Bounce
  2. {
  3.    static var version = "1.1.0.52";
  4.    function Bounce()
  5.    {
  6.    }
  7.    static function easeOut(t, b, c, d)
  8.    {
  9.       if((t /= d) < 0.36363636363636365)
  10.       {
  11.          return c * (7.5625 * t * t) + b;
  12.       }
  13.       if(t < 0.7272727272727273)
  14.       {
  15.          return c * (7.5625 * (t -= 0.5454545454545454) * t + 0.75) + b;
  16.       }
  17.       if(t < 0.9090909090909091)
  18.       {
  19.          return c * (7.5625 * (t -= 0.8181818181818182) * t + 0.9375) + b;
  20.       }
  21.       return c * (7.5625 * (t -= 0.9545454545454546) * t + 0.984375) + b;
  22.    }
  23.    static function easeIn(t, b, c, d)
  24.    {
  25.       return c - mx.transitions.easing.Bounce.easeOut(d - t,0,c,d) + b;
  26.    }
  27.    static function easeInOut(t, b, c, d)
  28.    {
  29.       if(t < d / 2)
  30.       {
  31.          return mx.transitions.easing.Bounce.easeIn(t * 2,0,c,d) * 0.5 + b;
  32.       }
  33.       return mx.transitions.easing.Bounce.easeOut(t * 2 - d,0,c,d) * 0.5 + c * 0.5 + b;
  34.    }
  35. }
  36.