# Infinite Menu - Limit Speed

**URL:** <https://forum.kirupa.com/t/infinite-menu-limit-speed/227353>\
**Category:** flash\
**Created:** [May 29, 2007, 4:34pm UTC](https://forum.kirupa.com/t/infinite-menu-limit-speed/227353 "2007-05-29T16:34:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matm00](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/matm00/32/2487_2.png) [@matm00](https://forum.kirupa.com/u/matm00)\
**Post date:** [May 29, 2007, 4:34pm UTC](https://forum.kirupa.com/t/infinite-menu-limit-speed/227353/1 "2007-05-29T16:34:49Z")

</div>

Hi, I’m experimenting with the infinite menu code on this site. I was wondering if there’s a way I can limit the maximum speed at which my movieclip scrolls (I’ve changed it so it scrolls vertically as well)? When you move the mouse to the top extremity of the main movie my scrolling movieclip zooms by so fast you can’t see it. I’m sure it’s just a simple matter of putting a limit on the result of ‘distance \* speed’, but I’m not sure how I’d go about doing that.

```auto

onClipEvent (load) {
    ycenter = 447;
    speed = 1/10;
}

onClipEvent (enterFrame) {
    var distance = _root._ymouse-ycenter;
    _y += (distance * speed);
    if (_y > 0) _y =- 685;
    if (_y < -685) _y = 0;
}

```
