Vertical Volume Slider with height != 100

The code for creating a vertical volume slider is pretty easy if the pixel range of the slider equals 100 pixels. However, what if you want it to be more or less than 100? Here’s my code, which I have on the slider knob. It calulates it’s range based on the height of the line under the sliding knob. The line is called vbase.

onClipEvent(load) {
_root.vbase._height=100;
_root.vbase._x=14;
this._y = _root.vbase._y + _root.vbase._height/2 - this._height/2;
left=this._x
top= this._y + _root.vbase._height/2
right=this._x
bottom=this._y - _root.vbase._height/2
//
volCalc=_y+50 // assuming the vbase line = 100 pixels
}
//End of onClipEvent load
//
onClipEvent(enterFrame) {
volCalc2=(_y-volCalc)*-1;
_root.globalSound.setVolume(volCalc2);
_root.currentVolumeText="Volume: " + _root.globalSound.getVolume();
}
//End of onClipEvent enterFrame
onClipEvent(mouseDown) {
startDrag(this, false, left, top, right, bottom)
}
//
onClipEvent(mouseUp) {
this.stopDrag();
}

The above works fine if vbase height is 100, but what if the height of vbase = 78? or 235? Thanks.