# Drag movieclip

**URL:** <https://forum.kirupa.com/t/drag-movieclip/182688>\
**Category:** flash\
**Created:** [March 20, 2006, 6:51pm UTC](https://forum.kirupa.com/t/drag-movieclip/182688 "2006-03-20T18:51:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyDNA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MyDNA](https://forum.kirupa.com/u/MyDNA)\
**Post date:** [March 20, 2006, 6:51pm UTC](https://forum.kirupa.com/t/drag-movieclip/182688/1 "2006-03-20T18:51:22Z")

</div>

I made a movieclip wich need the possibillity to being dragged only to the left for like 300 pixels. Ofcourse it also need the possibillity to drag it back to it’s start position.

so i gave it the next code:  
[AS]  
on (press) {  
startDrag( \_x , true , 300 , 0 , 0 , 0);  
}  
[/AS]

But it doesn’t do anything.  
What am i doing wrong? I think there will be someone who can help me out in this one.  
Learning actionscript is sometimes really frustrating.

Jos

---

<div class="post-metadata">

**Author:** ![rafael](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@rafael](https://forum.kirupa.com/u/rafael)\
**Post date:** [March 20, 2006, 9:08pm UTC](https://forum.kirupa.com/t/drag-movieclip/182688/2 "2006-03-20T21:08:01Z")

</div>

the first parameter should be the \<target\>

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [March 20, 2006, 9:14pm UTC](https://forum.kirupa.com/t/drag-movieclip/182688/3 "2006-03-20T21:14:37Z")

</div>

```auto
on (press) {
 this.startDrag(false, this._x - 300, this._y, this._x, this._y);
}
on (release) {
 stopDrag();
}

```
