# onPress doesn't scroll continuously - help?

**URL:** <https://forum.kirupa.com/t/onpress-doesnt-scroll-continuously-help/232386>\
**Category:** flash\
**Created:** [July 13, 2007, 9:54am UTC](https://forum.kirupa.com/t/onpress-doesnt-scroll-continuously-help/232386 "2007-07-13T09:54:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Head\_In\_A\_Pan](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@Head\_In\_A\_Pan](https://forum.kirupa.com/u/Head_In_A_Pan)\
**Post date:** [July 13, 2007, 9:54am UTC](https://forum.kirupa.com/t/onpress-doesnt-scroll-continuously-help/232386/1 "2007-07-13T09:54:08Z")

</div>

Hello,

My btns don’t scroll continuously when I use onPress -

How would I get the scrolling function to repeat itself while the btn is being pressed?

```auto

_global.mainTL = this;
//load an image into the pic clip inside the window clip

//create scrollable clip
mc_win.scrollRect = new flash.geom.Rectangle(0, 0, 300, 200);
//--------------------------------- end initialization -----------------------\\
//--------------------------------- code for scrollers -----------------------\\
btn_up.onPress = function() {

    target = mainTL.mc_win;
    var scrollUp = target.scrollRect;
    var scrollmax = target._y;

    if (scrollUp.y>scrollmax) {
        scrollUp.y -= 10;
        target.scrollRect = scrollUp;

    }
};
btn_down.onPress = function() {

    target = mainTL.mc_win;
    var scrollDown = target.scrollRect;
    var scrollmax = scrollDown.height;

    if (scrollDown.y<scrollmax) {
        scrollDown.y += 10;
        target.scrollRect = scrollDown;
    }

};
//--------------------------------- end scroller code -----------------------\\
stop();

```
