Horizontal scrollbar problem

Hey!
I’ve tried to use the “Simple Custom Scrollbar” tutorial to create a horizontal scrollbar instead of the vertical.
I’ve changed the defenitions like this:

scrolling = function () {
var scrollWidth:Number = scrollTrack._Width;
var contentWidth:Number = contentMain._Width;
var scrollFaceWidth:Number = scrollFace._Width;
var maskWidth:Number = maskedView._Width;
var initPosition:Number = scrollFace._x=scrollTrack._x;
var initContentPos:Number = contentMain._x;
var finalContentPos:Number = maskWidth-contentWidth+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._x;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._Width-scrollFaceWidth+scrollTrack._x;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentWidth-maskWidth)/(scrollWidth-scrollFaceWidth);

scrollFace.onPress = function() {
var currPos:Number = this._x;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._x);
contentMain._x = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=top) {
scrollFace._x = top;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = top;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRollOut = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=bottom) {
scrollFace._x = bottom;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = bottom;
contentMain._x = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};

if (contentWidth<maskWidth) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();

I put the “Width” instead of the “height”, and “x” instead of “y”.
What I’ve got is when I push on the “scrollFace” button it slides but disappears immidietly, and the the image (which is “movieclip” as well) beneath the masked area freezes.

I’d like to know what’s wrong with the script, if anyone of you can help :crying: …

  • In addition - I have to make this scrollbar move from right to left - Is there any additional defenitions I must concern?

Thank you!