In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Reverse Easing Function

...
@author 9re
Get Adobe Flash player
by 9re 23 Jun 2009
/**
 * Copyright 9re ( http://wonderfl.net/user/9re )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/kHq6
 */

// forked from 9re's Easing function
package  
{
	import flash.display.Sprite;

        import mx.effects.easing.*;
	/**
	 * ...
	 * @author 9re
	 */
	public class Easing extends Sprite
	{
	        private var sw:int = stage.stageWidth;
	        private var sh:int = stage.stageHeight;
		public function Easing() 
		{
                        // draw axis
                        graphics.lineStyle(1, 0xff0000);
                        graphics.moveTo(0, sh - 150);
                        graphics.lineTo(sw, sh - 150);
                        graphics.moveTo(100, 0);
                        graphics.lineTo(100, sh);

			graphics.lineStyle(1);
			graphics.moveTo(100, sh - 180);

                        var reverse:Function = getReverseFunction(Quadratic.easeOut);
			for (var i:int = 1; i < sw - 200; ++i) 
			{
                                graphics.lineTo(i + 100, Quadratic.easeOut(i, sh - 180, -sh + 250, sw - 200));
				graphics.lineTo(i + 100, reverse(i, sh - 180, -sh + 250, sw - 200));
			}
		}

                private function getReverseFunction(easing:Function):Function {
                    return function(t:Number, b:Number, c:Number, d:Number):Number {
                        return easing(d - t, b, c, d);
                    };
                }
	}
}