# Adding inertia on looped onRollOver

**URL:** <https://forum.kirupa.com/t/adding-inertia-on-looped-onrollover/199946>\
**Category:** flash\
**Created:** [September 7, 2006, 1:28pm UTC](https://forum.kirupa.com/t/adding-inertia-on-looped-onrollover/199946 "2006-09-07T13:28:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nova4](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@Nova4](https://forum.kirupa.com/u/Nova4)\
**Post date:** [September 7, 2006, 1:28pm UTC](https://forum.kirupa.com/t/adding-inertia-on-looped-onrollover/199946/1 "2006-09-07T13:28:26Z")

</div>

Gday yall…  
I need to add inertia (gradual slowing down of the clip before it comes to a stop) to the following code :

up.onRollOver = function () {  
\_parent.pages.onEnterFrame = function(){  
\_parent.pages.\_y -= 3;  
}  
}

This code is a looped onRollOver, sa long as the mouse cursor is within “up”, the movieClip moves up 3 pix at a time. I need it to slow down simulating inertia when the cursor is removed.

I know a code that usually works {

f=0.3;  
xdest = 300;  
onEnterFrame = function () {  
movingClip\_mc.\_x += (xdest - movingClip\_mc.\_x) \* f;  
}  
}

But in this case it doesn’t…  
Any ideas are gladly welcome.
