# Dragging a movieclip with easing

**URL:** <https://forum.kirupa.com/t/dragging-a-movieclip-with-easing/180331>\
**Category:** flash\
**Created:** [February 27, 2006, 9:07pm UTC](https://forum.kirupa.com/t/dragging-a-movieclip-with-easing/180331 "2006-02-27T21:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![culppie](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/culppie/32/2001_2.png) [@culppie](https://forum.kirupa.com/u/culppie)\
**Post date:** [February 27, 2006, 9:07pm UTC](https://forum.kirupa.com/t/dragging-a-movieclip-with-easing/180331/1 "2006-02-27T21:07:10Z")

</div>

Hey all.

A friend of mine is building a site and wants to be able to drag across an oversized movieclip, similar to the dragging effect at

[http://www.conceptm.nl/](http://www.conceptm.nl/)

I’ve tried several scripts and can’t get it right. I’m trying to get the dragging to ease like it does on that site, but haven’t had any luck.

Any ideas?  
Thanks!

Thomas :thumb2:

---

<div class="post-metadata">

**Author:** ![muse](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/muse/32/61_2.png) [@muse](https://forum.kirupa.com/u/muse)\
**Post date:** [March 24, 2006, 11:10pm UTC](https://forum.kirupa.com/t/dragging-a-movieclip-with-easing/180331/2 "2006-03-24T23:10:28Z")

</div>

> [@BrAnDX105](#):
>
> You could try something like:
> 
> ```auto
> 
> //used to drag your MC, whatever it may be
> your_mc.onPress = function() {
> this.startDrag();
> this.onEnterFrame = function(){
> this.easeTo(_root._xmouse,_root._ymouse,3);
> }
> };
> your_mc.onRelease = function() {
> this.stopDrag();
> };
> //used to ease your MC to a position, in this case, the mouses location
> MovieClip.prototype.easeTo = function(x, y, speed) {
> this._x -= (this._x - x) / speed;
> this._y -= (this._y - y) / speed;
> };
> 
> ```
> 
> I’m not sure if this works 100%, but that’s the general idea. You initiate the drag when you press down on the MC, and ease it to the X and Y of the mouse, and on release you stop the drag.

I’m trying to achieve the same effect as [ConceptM.com](http://ConceptM.com). Has anyone had luck with getting this script to work? thanks

---

<div class="post-metadata">

**Author:** ![rynobot](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rynobot](https://forum.kirupa.com/u/rynobot)\
**Post date:** [April 12, 2006, 5:49am UTC](https://forum.kirupa.com/t/dragging-a-movieclip-with-easing/180331/3 "2006-04-12T05:49:42Z")

</div>

anyone know why the onRelease function to stop drag in that code does not work?
