I’m a noob when it comes to coding and I was wondering how I would convert this vertical scrollbar into a horizontal scrollbar
heres the code:
onClipEvent (load) {
diff_y = bound_box._height-scroller._height;
bounds = bound_box.getBounds(this);
top = bounds.yMin+(scroller._height/2);
bottom = bounds.yMax-(scroller._height/2);
function updateScrollbar () {
content._y = -(((scroller._y-top)/diff_y)*(content._height-bound_box._height));
}
friction = 0.90;
}
onClipEvent (mouseDown) {
if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
startDrag (“scroller”, false, scroller._x, top, scroller._x, bottom);
scrolling = true;
}
}
onClipEvent (mouseUp) {
stopDrag ();
scrolling = false;
}
onClipEvent (enterFrame) {
if (scrolling) {
updateScrollbar();
newY = scroller._y;
yspeed = (newY-oldY)*0.50;
oldY = newY;
done = false;
} else if (!done) {
oldypos = scroller._y;
newypos = oldypos+yspeed;
if (yspeed<-0.2 || yspeed>0.2) {
yspeed *= friction;
} else {
yspeed = 0;
done = true;
}
if (newypos<top) {
yspeed = -1yspeedfriction;
newypos = top;
}
if (newypos>bottom) {
yspeed = -1yspeedfriction;
newypos = bottom;
}
scroller._y = newypos;
updateScrollbar();
}
}