Stage scroller problema

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 :frowning:

here’s the code


// 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;
}