# Problem onRollOut

**URL:** https://forum.kirupa.com/t/problem-onrollout/268321
**Category:** flash
**Created:** [August 12, 2008, 3:31pm UTC](https://forum.kirupa.com/t/problem-onrollout/268321 "2008-08-12T15:31:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jcprovideo](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@jcprovideo](https://forum.kirupa.com/u/jcprovideo)
#### Post date: [August 12, 2008, 3:31pm UTC](https://forum.kirupa.com/t/problem-onrollout/268321/1 "2008-08-12T15:31:51Z")

</div>

I have a simple scroller that scrolls up or down as the user moves their mouse. The problem is that when you RollOut the scroller keeps moving. I can’t figure out how to put a onRollOut function that will stop the scroll upon RollOut. Can you help?

years.onRollOver = yearsOver;

function yearsOver() {  
this.onEnterFrame = yearsPanel;  
delete this.onRollOver;  
}

function yearsPanel() {  
if (\_xmouse\<b.xMin || \_xmouse\>b.xMax || \_ymouse\<b.yMin || \_ymouse\>b.yMax) {  
this.onRollOver = yearsOver;  
delete this.onEnterFrame;  
}  
if (years.\_y \>= 80) {  
years.\_y = 80;  
}  
if (years.\_y \<= -90) {  
years.\_y = -90;  
}  
var ydist = \_ymouse -170;  
years.\_y += Math.round(-ydist/7);  
}

var b = stroke.getBounds(\_root);
