# Custom easing - AS2

**URL:** https://forum.kirupa.com/t/custom-easing-as2/280963
**Category:** flash
**Created:** [February 3, 2009, 2:47pm UTC](https://forum.kirupa.com/t/custom-easing-as2/280963 "2009-02-03T14:47:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mxvans](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mxvans](https://forum.kirupa.com/u/mxvans)
#### Post date: [February 3, 2009, 2:47pm UTC](https://forum.kirupa.com/t/custom-easing-as2/280963/1 "2009-02-03T14:47:43Z")

</div>

Hi - I need to set a mouse-controlled scrolling animation to ease when it starts and when it stops in AS2.

Here’s my current onEnterFrame script. Might be a little crude, but it succeeds in starting and stopping the animation when the mouse rolls off the movie. Moves left on one side and right on the other. I just want the starting and stopping to be eased a bit.

Can anyone help? Thanks in advance.

\_root.onEnterFrame = function() {  
if(\_root.\_ymouse\<10){  
myVar=false;  
}  
if(\_root.\_ymouse\>408){  
myVar=false;  
}  
if(\_root.\_ymouse\>20 and \_root.\_ymouse\<398){  
myVar=true;  
}  
if(\_root.\_xmouse\<180 and \_root.\_xmouse\>9 and myVar==true){  
ImageBar.prevFrame();  
}  
if(\_root.\_xmouse\>779 and \_root.\_xmouse\<890 and myVar==true){  
ImageBar.nextFrame();  
}  
}
