# Get Momentum of a Tween

**URL:** <https://forum.kirupa.com/t/get-momentum-of-a-tween/331616>\
**Category:** flash\
**Created:** [September 11, 2013, 3:39am UTC](https://forum.kirupa.com/t/get-momentum-of-a-tween/331616 "2013-09-11T03:39:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiwirob](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kiwirob/32/7153_2.png) [@kiwirob](https://forum.kirupa.com/u/kiwirob)\
**Post date:** [September 11, 2013, 3:39am UTC](https://forum.kirupa.com/t/get-momentum-of-a-tween/331616/1 "2013-09-11T03:39:32Z")

</div>

Hi there

I’m wanting to create a variable that changes with the speed of a tween. The faster the tween the higher the variable, the slower the tween the lower the variable. for example: The below tween has an easeInOut so the start of the tween would be the slowest and the variable would = 0. At the middle point of the tween would be the fastest and the variable would = 10. Then as the tween winds back down the variable would reduce back to 0.

```php
var HeroTween:Tween = new Tween(Hero, "_y", Regular.easeInOut, 92, 396, 2, true); 
    HeroTween.onMotionChanged = function() {         
    //here is where I want to trace the momentum/speed of the tween 
};  

```

Any help would be appreciated ![](http://forum.kirupa.com/uploads/kirupa/1105/8ed432c9025fd9ca.gif)
