# How to use variables for easing Class and esing Method of Tween animation?

**URL:** <https://forum.kirupa.com/t/how-to-use-variables-for-easing-class-and-esing-method-of-tween-animation/265882>\
**Category:** flash\
**Created:** [July 14, 2008, 7:20am UTC](https://forum.kirupa.com/t/how-to-use-variables-for-easing-class-and-esing-method-of-tween-animation/265882 "2008-07-14T07:20:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex298](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@alex298](https://forum.kirupa.com/u/alex298)\
**Post date:** [July 14, 2008, 7:20am UTC](https://forum.kirupa.com/t/how-to-use-variables-for-easing-class-and-esing-method-of-tween-animation/265882/1 "2008-07-14T07:20:38Z")

</div>

Hello,

I am using ActionScript 3 to do Tween animation. I have two combo boxes that allow user to select the easing Class (e.g. Regular, Back, Bounce, Elastic, Regular, Strong and None) and easing Method (e.g. easeOut, easeIn, easeInOut, easeNone).

How can I use “variables” for the easing Class and easing Method of Tween animation.

For example, the following works:

> 

var easeMethod:Function = Regular.easeOut;  
var tweenX:Tween = new Tween(ball\_mc, “x”, easeMethod, 0, 150, 3, true);

However I wish to use like that:

> 

var easeMethod:Function = easingClassCombo.selectedLabel.easingMethodCombo.selectedLabel;  
var tweenX:Tween = new Tween(ball\_mc, “x”, easeMethod, 0, 150, 3, true);

How can I do that?

Thanks and best regards

Alex

---

<div class="post-metadata">

**Author:** ![wvxvw](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wvxvw](https://forum.kirupa.com/u/wvxvw)\
**Post date:** [July 14, 2008, 10:25am UTC](https://forum.kirupa.com/t/how-to-use-variables-for-easing-class-and-esing-method-of-tween-animation/265882/2 "2008-07-14T10:25:22Z")

</div>

```auto
var easeMethod:Function = fl.transitions.easing[easingClassCombo.selectedLabel.easingMethodCombo.selectedLabel.split["."][0]][easingClassCombo.selectedLabel.easingMethodCombo.selectedLabel.split["."][1]] as Function;

```

Assuming easingClassCombo.selectedLabel.easingMethodCombo.selectedLabel == “Bounce.easeInOut”. But the first way you tried looks more comprehensible to me.

---

<div class="post-metadata">

**Author:** ![Easyforpp](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Easyforpp](https://forum.kirupa.com/u/Easyforpp)\
**Post date:** [July 14, 2008, 3:19pm UTC](https://forum.kirupa.com/t/how-to-use-variables-for-easing-class-and-esing-method-of-tween-animation/265882/3 "2008-07-14T15:19:48Z")

</div>

bump up …--------------------------------our wow gold site:_buy [wow gold, cheap [url=http://www.wowgoldcc.cn/wowgoldworld.htm]wow gold, free [url=http://www.wowgoldcc.cn/Newplayers.htm]wow gold](http://www.wowgoldcc.cn),_
