CustomEase

Sometimes the standard easing equations (Elastic, Strong, etc.) don't give you quite what you want. This tool allows you to interactively draw a curve for your own custom easing equation and it even writes the code for you. Just copy and paste it into your AS3 or AS2 application. The code it writes requires the com.greensock.easing.CustomEase class which is a membership benefit of Club GreenSock.

Get Adobe Flash player

USAGE

Once you create your custom ease there are a few ways you can refer to your custom easing equation. Here are a few options:

import com.greensock.easing.CustomEase;
import com.greensock.TweenLite;

CustomEase.create("myCustomEase", [{s:0,cp:0.394,e:0.644},{s:0.644,cp:0.894,e:1}]); //do this only once for each custom ease you want to create.

//then later...
TweenLite.to(mc, 2, {x:"250", ease:CustomEase.byName("myCustomEase"), delay:1});

Or to speed things up slightly, you could store a reference to the easing function instead of calling the CustomEase.byName() function each time:

import com.greensock.easing.CustomEase;
import com.greensock.TweenLite;

var myEase:Function = CustomEase.create("myCustomEase", [{s:0,cp:0.394,e:0.644},{s:0.644,cp:0.894,e:1}]); //do this only once for each custom ease you want to create.

//then later...
TweenLite.to(mc, 2, {x:"250", ease:myEase, delay:1});

Or if you prefer to keep track of the CustomEase instance instead, you can reference its easing function with the "ease" property, like:

import com.greensock.easing.CustomEase;
import com.greensock.TweenLite;

var myEase:CustomEase = new CustomEase("myCustomEase", [{s:0,cp:0.394,e:0.644},{s:0.644,cp:0.894,e:1}]); //do this only once for each custom ease you want to create.

//then later...
TweenLite.to(mc, 2, {x:"250", ease:myEase.ease, delay:1});

FAQ

  1. I don't see a download link? Where do I get the CustomEase class?The com.greensock.easing.CustomEase class comes with your memebership to Club GreenSock. When you join, you'll get a confirmation e-mail with a link to download the bonus classes.
  2. Does this tool write code that's compatible with other tweening engines?It sure does. It follows the standard format for easing equations, accepting 4 parameters: time, start value, change in value, duration. You should be able to use it with virtually any tweening engine.
  3. Is there an AS2 version of CustomEase available or is it only built in AS3?Just like my tweening classes, there are AS2- and AS3-compatible versions of CustomEase. They work EXACTLY the same. The interactive tool is built in AS3, but the code it generates is compatible with both.

Need help?

Feel free to post your question on the forums. You'll increase your chances of getting a prompt answer if you provide a brief explanation and include a simplified FLA file (and any class files) that clearly demonstrates the problem.

Get GSAP

Version: 1.20.3 updated 2017-10-02

Core

    Extras

      Plugins

        By using GreenSock code, you agree to the terms of use.

        For an all-access pass to premium content

        Join Club GreenSock