# Stop drag!

**URL:** <https://forum.kirupa.com/t/stop-drag/162132>\
**Category:** Uncategorized\
**Created:** [September 9, 2005, 11:01pm UTC](https://forum.kirupa.com/t/stop-drag/162132 "2005-09-09T23:01:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lord\_Rahl](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Lord\_Rahl](https://forum.kirupa.com/u/Lord_Rahl)\
**Post date:** [September 9, 2005, 11:01pm UTC](https://forum.kirupa.com/t/stop-drag/162132/1 "2005-09-09T23:01:36Z")

</div>

Need some help real quick. I have my project set up so when a button is clicked, it makes a variable = true, creates a MC at mouse x and y position, and draged by mouse. It works, but I can’t seem to get the stopDrag(); to work now. Here is what I have.  
Within the Button

```auto

on(release){
 _root.buildingsomething=true;
 _root.attachMovie ("BoxMc", "BoxMc"+ 1, getNextHighestDepth());
 _root.BoxMc1._x = _root._xmouse;
 _root.BoxMc1._y = _root._ymouse;
 _root.BoxMc1.startDrag();
 Mouse.hide();
}

```

In the main timeline.

```auto

BoxMc1.onMouseDown = function() {
 if(_root.buildingsomething==true){
 _root.BoxMc1.stopDrag();
 _root.buildingsomething=false;
 } 
if(_root.buildingsomething==false){
 _root.menu.gotoAndStop(3);
 }
};

```

But it doesn’t work. 😛
