# Sliding problem

**URL:** <https://forum.kirupa.com/t/sliding-problem/195070>\
**Category:** flash\
**Created:** [July 28, 2006, 6:49am UTC](https://forum.kirupa.com/t/sliding-problem/195070 "2006-07-28T06:49:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![no\_rain](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@no\_rain](https://forum.kirupa.com/u/no_rain)\
**Post date:** [July 28, 2006, 6:49am UTC](https://forum.kirupa.com/t/sliding-problem/195070/1 "2006-07-28T06:49:11Z")

</div>

Ok so I have a movie clip that scrolls down and up when you roll over the up and down buttons exactly 200px every time. this is my code:  
MovieClip.prototype.moveDir = function(Xdistance:Number, Ydistance:Number, ease:Number) {  
delete this.onEnterFrame;  
Ydistance ? this.newY=(this.\_y-Ydistance) : null;  
Xdistance ? this.newX=(this.\_x-Xdistance) : null;  
this.onEnterFrame = function() {  
Ydistance ? this.\_y -= Math.round((this.\_y-this.newY)/ease) : null;  
Xdistance ? this.\_x -= Math.round((this.\_x-this.newX)/ease) : null;  
};  
};  
r.onRollOver=function () {  
menu.moveDir(200, 0, 5);  
}, l.onRollOver=function () {  
menu.moveDir(-200, 0, 5);  
};

but how do I get it to not take effect when the movie clip ends? thanks for any help
