# Stage scroller problema

**URL:** <https://forum.kirupa.com/t/stage-scroller-problema/200063>\
**Category:** Uncategorized\
**Created:** [September 8, 2006, 11:57am UTC](https://forum.kirupa.com/t/stage-scroller-problema/200063 "2006-09-08T11:57:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skiele](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/skiele/32/2790_2.png) [@skiele](https://forum.kirupa.com/u/skiele)\
**Post date:** [September 8, 2006, 11:57am UTC](https://forum.kirupa.com/t/stage-scroller-problema/200063/1 "2006-09-08T11:57:11Z")

</div>

hi all,  
im working on a “stage scroller” that allow to scroll the content of a page…

but there is a problem…

when the content is smaller than the stage the dragging allows me to invert the scrolling…

sorry for my bad english ☹

here’s the code

```auto

// finestra flash resizable
scala = false;
Stage.align = "T";
Stage.scaleMode = "showAll";
wdth = Stage.width;
hght = Stage.height;
Stage.scaleMode = "noScale";
controllo = new Object();
controllo.onResize = function(){
    w = Stage.width
    h = Stage.height
    cx = (w-wdth)/2;
    cy = (h-hght);
    stageH = hght+cy;
    stageW = wdth+cx;
};
Stage.addListener(controllo);

/*
 MovieClip.prototype.move = function(x,y){
    this._x += (x-this._x)/4;
    this._y += (y-this._y)/4;
};*/

this.onEnterFrame = function(){
    speed = 4;
    // posizione e dimensione del porta-barra ////////////////////////
    portaBarra._y = stageH - stageH;
    portaBarra._height += (stageH-portaBarra._height)/speed;
    portaBarra._x += ((stageW-portaBarra._width) - portaBarra._x)/speed;
};
controllo.onResize();

//////////////////////////
// drag della scrollbar //
//////////////////////////
barra.onEnterFrame = function(){
    if(rewind == true){
        barra.prevFrame();
    }
}
barra.onRollOver = function(){
    rewind = false;
    barra.play();
}
barra.onRollOut = function(){
    rewind = true;
}

barra.onPress = function() {
   startDrag(barra, false, (stageW-barra._width), (stageH-stageH), (stageW-barra._width), (stageH - barra._height));
}
barra.onRelease = function() {
   stopDrag();
}
barra.onReleaseOutside = function() {
   stopDrag();
   rewind = true;
}

```
