# I need help stopping a drag actionscript

**URL:** <https://forum.kirupa.com/t/i-need-help-stopping-a-drag-actionscript/26499>\
**Category:** Uncategorized\
**Created:** [July 23, 2003, 5:19pm UTC](https://forum.kirupa.com/t/i-need-help-stopping-a-drag-actionscript/26499 "2003-07-23T17:19:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![corrigon](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@corrigon](https://forum.kirupa.com/u/corrigon)\
**Post date:** [July 23, 2003, 5:19pm UTC](https://forum.kirupa.com/t/i-need-help-stopping-a-drag-actionscript/26499/1 "2003-07-23T17:19:31Z")

</div>

Hiya,  
Im using this actionscript:  
[http://www.kirupa.com/developer/mx/followease.htm](http://www.kirupa.com/developer/mx/followease.htm)

But want to be able to start and stop the drag effect.

How do i do this?

Please help,

-corrigon:sigh:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 5:23pm UTC](https://forum.kirupa.com/t/i-need-help-stopping-a-drag-actionscript/26499/2 "2003-07-23T17:23:00Z")

</div>

change  
[AS]onClipEvent (enterFrame) {  
endX = \_root.\_xmouse;  
endY = \_root.\_ymouse;  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
}[/AS]

to…

[AS]onClipEvent (enterFrame) {  
if(\_root.drag)  
endX = \_root.\_xmouse;  
endY = \_root.\_ymouse;  
\_x += (endX-\_x)/speed;  
\_y += (endY-\_y)/speed;  
}  
}[/AS]

then apply these actions to the button:  
[AS]on(release) {  
if(!\_root.drag) {  
\_root.drag = true;  
} else {  
\_root.drag = false;  
}  
}[/AS]

The button just changes a variable stored in \_root to true/false and the if() in the other code checks it!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 5:25pm UTC](https://forum.kirupa.com/t/i-need-help-stopping-a-drag-actionscript/26499/3 "2003-07-23T17:25:24Z")

</div>

thank!!!

flash is very complicated but im getting ther!
