# Controlling movieclip position

**URL:** <https://forum.kirupa.com/t/controlling-movieclip-position/268862>\
**Category:** flash\
**Created:** [August 19, 2008, 8:10pm UTC](https://forum.kirupa.com/t/controlling-movieclip-position/268862 "2008-08-19T20:10:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfandango](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@alfandango](https://forum.kirupa.com/u/alfandango)\
**Post date:** [August 19, 2008, 8:10pm UTC](https://forum.kirupa.com/t/controlling-movieclip-position/268862/1 "2008-08-19T20:10:11Z")

</div>

Hey, I’m building a gallery for my new site and scroll the thumbnails inside a movieclip controlled by up/down buttons. I’ve got the scrolligg to work fine but now I need it to stop when it reaches a certain point.

[Here’s an example](http://img363.imageshack.us/my.php?image=flashlz5.swf) of what I’m working on. As you’ll see, if you keep hovering on the up or down buttons the thumbnails keep moving and disappear.

I’m using the following code:

```auto
gallery_up_btn.onRollOver = function() {
    gallery.onEnterFrame = function() {
        this._y -= 4;
    };
};

gallery_up_btn.onRollOut = function() {
    delete gallery.onEnterFrame;
};

gallery_down_btn.onRollOver = function() {
    gallery.onEnterFrame = function() {
        this._y += 4;
    };
};

gallery_down_btn.onRollOut = function() {
    delete gallery.onEnterFrame;
};

```

Any ideas?

Al
