Drag functionality

Hi!

Im busy making a map with drag functionality, problem is that the map is about 3000pixels wide, onMouseDown the entire map jumps to, what i think is the registration point. does anyone know how to fix this, my code is below.

Thanks in advance,

rail.onPress = function(){

this.onMouseMove = function(){
    this._x = this._parent._xmouse;        
}

this.onMouseMove = function(){
    this._x = this._parent._xmouse; 
}

}
rail.onRelease = rail.onReleaseOutside = function(){
delete this.onMouseMove;
}