# Stop a function onRollOut

**URL:** https://forum.kirupa.com/t/stop-a-function-onrollout/280416
**Category:** Uncategorized
**Created:** [January 27, 2009, 1:37pm UTC](https://forum.kirupa.com/t/stop-a-function-onrollout/280416 "2009-01-27T13:37:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![slackulator](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@slackulator](https://forum.kirupa.com/u/slackulator)
#### Post date: [January 27, 2009, 1:37pm UTC](https://forum.kirupa.com/t/stop-a-function-onrollout/280416/1 "2009-01-27T13:37:58Z")

</div>

Hello everyone,

I have some thumbnails on my stage inside a movieclip, and the following code which basically moves them right or left, when the mouse goes right or left. What I want to do is stop the scrolling when I rollout the movieclip which contains the thumbnails.

Here is the code:

```auto
panel.onRollOver = panelOver;
function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
}

function scrollPanel() {
    if (_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
        this.onRollOver = panelOver;
        delete this.onEnterFrame;
    }
    if (panel._x>=2600) {
        panel._x = 2600;
    }
    if (panel._x<=-1800) {
        panel._x = -1800;
    }
    var xdist = _xmouse-250;
    panel._x += Math.round(-xdist/7);
}

```

[LEFT]

Any suggestions? 😊  
[/LEFT]
