# How to pause a moving object on mouse rollOver

**URL:** <https://forum.kirupa.com/t/how-to-pause-a-moving-object-on-mouse-rollover/210019>\
**Category:** flash\
**Created:** [December 14, 2006, 4:09am UTC](https://forum.kirupa.com/t/how-to-pause-a-moving-object-on-mouse-rollover/210019 "2006-12-14T04:09:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael1](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@michael1](https://forum.kirupa.com/u/michael1)\
**Post date:** [December 14, 2006, 4:09am UTC](https://forum.kirupa.com/t/how-to-pause-a-moving-object-on-mouse-rollover/210019/1 "2006-12-14T04:09:06Z")

</div>

Sup All //

I am trying to achieve a rollover effect like this menu.

[http://www.ravijour.com/](http://www.ravijour.com/)

The menu is working and sliding perfectly, however it’s still a little squirmish, and if I can’t figure this out I’ll deal with it and let it slide. However it’s bugging me and want to correct the “sluggishness” of this issue. I want the menu to pause, or rest when you open it, so that there isn’t a chance the it can slide off of the users mouse pointer. 😃

Here is the code

```auto

onClipEvent (load) {
    _y = 0;
    speed = 5;
}
onClipEvent (enterFrame) {
    endY = _root._ymouse;
    _y += (endY-_y)/speed;
}

on(rollOver)
{
    speed = 0;
}
on(rollOut)
{
    speed = 5;
}

```

I thought a simple on (rollOver) speed = 0 would do the trick, however it just sends the menu in a frenzy. Hehe

Thanks all
