# Easing with Drag Command

**URL:** <https://forum.kirupa.com/t/easing-with-drag-command/191067>\
**Category:** Uncategorized\
**Created:** [June 16, 2006, 8:20pm UTC](https://forum.kirupa.com/t/easing-with-drag-command/191067 "2006-06-16T20:20:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mediumman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mediumman/32/551_2.png) [@mediumman](https://forum.kirupa.com/u/mediumman)\
**Post date:** [June 16, 2006, 8:20pm UTC](https://forum.kirupa.com/t/easing-with-drag-command/191067/1 "2006-06-16T20:20:11Z")

</div>

I am currently using Senoculars BeginDrag code to enable me to drag more than one object…this way i can use a custom cursor and still interact with buttons and movieclips…is there a way to modify the code to give an easing effect with the drag…below is the code…any help is appreciated…

MovieClip.prototype.beginDrag = function(target, lock, l, t, r, b){  
if (typeof target == “string”){  
target = eval(target);  
if (!target) return trace(“Warning: Invalid MovieClip for beginDrag. “+target);  
}else if (!(target instanceof MovieClip)){  
b=r; r=t; t=l; l=lock; lock=target; target=this;  
}  
if (target.$dragMethod) target.endDrag();  
target.$dragMethod = {MM:target.onMouseMove};  
ASSetPropFlags(target,”$dragMethod”,1,1);  
target.addProperty(“onMouseMove”,arguments.callee.getMM,arguments.callee.setMM);  
ASSetPropFlags(target,“onMouseMove”,3);  
var constrain = (arguments.length \> 1);  
var off\_x = 0, off\_y = 0;  
if (!lock){  
off\_x = target.\_parent.\_xmouse-target.\_x;  
off\_y = target.\_parent.\_ymouse-target.\_y;  
}  
target.$dragMethod.drag = function(){  
target.\_x = target.\_parent.\_xmouse-off\_x;  
target.\_y = target.\_parent.\_ymouse-off\_y;  
if (constrain){  
if (typeof l == “object”){  
t = l.ymin;  
r = l.xmax;  
b = l.ymax;  
l = l.xmin;  
}  
if (target.\_x \< l) target.\_x = l;  
else if (target.\_x \> r) target.\_x = r;  
if (target.\_y \< t) target.\_y = t;  
else if (target.\_y \> b) target.\_y = b;  
}  
updateAfterEvent();  
}  
}  
MovieClip.prototype.beginDrag.getMM = function(){  
this.$dragMethod.drag();  
return this.$dragMethod.MM;  
}  
MovieClip.prototype.beginDrag.setMM = function(f){  
this.$dragMethod.MM = f;  
}   
MovieClip.prototype.endDrag = function(target){  
if (arguments.length){  
if (typeof target == “string”) target = eval(target);  
if (!target) return trace("Warning: Invalid MovieClip for beginDrag. "+target);  
}else target = this;  
ASSetPropFlags(target,“onMouseMove”,0,3);  
delete target.onMouseMove;  
if (target.$dragMethod.MM) target.onMouseMove = target.$dragMethod.MM;  
delete target.$dragMethod;  
target.startDrag(); // for \_droptarget  
target.stopDrag();  
}
