# Drag functionality

**URL:** <https://forum.kirupa.com/t/drag-functionality/320600>\
**Category:** Uncategorized\
**Created:** [March 28, 2011, 8:26am UTC](https://forum.kirupa.com/t/drag-functionality/320600 "2011-03-28T08:26:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charldesign](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@charldesign](https://forum.kirupa.com/u/charldesign)\
**Post date:** [March 28, 2011, 8:26am UTC](https://forum.kirupa.com/t/drag-functionality/320600/1 "2011-03-28T08:26:50Z")

</div>

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;  
}
