Horizontal Scrollbar w/ MC issue

Hullo,

Having some issues with this AS that i’ve taken from an example tutorial. It originally used a vertical scroller, but I’ve changed it to horizontal. However, having issues with the ‘dragger’ itself - not dragging properly or keeping to the ‘bar’, etc. I wonder if someone could take a look for me?

I’ve changed the reference from height to width, and swapped the y’s for x’s, but it aint doing what it should do…

Thanks, Here it is:

fscommand(“allowscale”, “false”);
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
x = dragger._x;
top = main._x;
bottom = main._x+mask_mc._width-main._width-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._y, this._parent.x, this._x, this._parent.x+this._parent.bar._width-this._width);
dragger.scrollEase();
};
// Above is where the problem lies …
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._xmouse>this._x+this._width-this._parent.dragger._width) {
this._parent.dragger._x = this._parent._xmouse;
this._parent.dragger._x = this._x+this._width-this._parent.dragger._width;
} else {
this._parent.dragger._x = this._parent._xmouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._x>=x+bar._width-dragger._width && d == 1) || (dragger._x<=x && d == -1)) {
clearInterval(myInterval);
} else {
dragger._x += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 4, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 4, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dx) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._x-x)/(bar._width-this._width);
dx = Math.round((((top-(top-bottom)*r)-main._x)/speed)*friction);
main._x += dx;
};
};