Zoom slider

Hello,
I am using the below AS for a slider. The code is for a vertical slider. I just want to turn it 90 degrees for a horizontal slider. I thought I just needed to switch _y to _x, and I changed range.height to width, but its not quite working. The button is not positioning itself on the scaling bar.Thanks…(see “starting position in code”. that is not working properly when I rotate it.) After rotating, the slider handle positions itself way beyond the minimum side of the scale bar.

onClipEvent(load){

scrollMin = _root.range._y-_root.range._height // minimum _y value possiible for scrollbar
scrollMax = _root.range._y // maximum _y value possiible for scrollbar

lowestScale = 50 // lowest desired scale of map in %
highestScale = 200 // highest desired scale of map in %

_y = scrollMin + (scrollMax - scrollMin)/2 // sets starting position of scrollbar (currently half-way)


scaleFactor = Math.pow(highestScale/lowestScale,1/(scrollMax-scrollMin)) // variable for SetScale
function SetScale(){
	// calculates scale and sets it
	_root.scale = _root.map._xscale = _root.map._yscale = lowestScale * Math.pow(scaleFactor,(scrollMax-_y))
}
SetScale()

}
onClipEvent(mouseMove){
if (dragging){
_y = Math.min(Math.max(_parent._ymouse,scrollMin),scrollMax)
SetScale()
updateAfterEvent();
}
}