# Disable startDrag?

**URL:** <https://forum.kirupa.com/t/disable-startdrag/18469>\
**Category:** Uncategorized\
**Created:** [April 17, 2003, 12:49am UTC](https://forum.kirupa.com/t/disable-startdrag/18469 "2003-04-17T00:49:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 17, 2003, 12:49am UTC](https://forum.kirupa.com/t/disable-startdrag/18469/1 "2003-04-17T00:49:46Z")

</div>

:q: Is there any way to disable dragging while an animation is running?

I have a start/stop drag button on a movieclip and I want to not allow any dragging while animation of another movie clip is playing (since I can’t apply drag to more than one movie clip at a time I won’t allow any dragging at all!!!).

I have tried “movieclip1.stopDrag();” but it doesn’t work. At least, it doesn’t work when I have that code attached to the button that starts the animation!

Basically, I’d like to say:

on (release){ //of button that plays animation  
don’t allow any dragging anywhere!  
}

Any suggestions?

---

<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:** [April 17, 2003, 1:29am UTC](https://forum.kirupa.com/t/disable-startdrag/18469/2 "2003-04-17T01:29:39Z")

</div>

If you are using this kinda code for the drag part…

```php
 
_root.createEmptyMovieClip("container",1);
container.loadMovie("photo.jpg");
container._x = container._y = 50 ;

_root.onMouseDown = function () {
	startDrag ("container",false) ;
}
_root.onMouseUp = function () {
	stopDrag () ;
} 

```

Then can’t you just delete the drag part?

I’ve probably misunderstood you haven’t I?!

```php
 
_root.createEmptyMovieClip("container",1);
container.loadMovie("photo.jpg");
container._x = container._y = 50 ;

```

---

<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:** [April 17, 2003, 6:34am UTC](https://forum.kirupa.com/t/disable-startdrag/18469/3 "2003-04-17T06:34:26Z")

</div>

// try this:  
MovieClip.prototype.newStartDrag = function(mcRef, zLockCenter, nLeft, nTop, nRight, nBottom) {  
if (\_level0.zDragEnabled) {  
mcRef.startDrag(zLockCenter, nLeft, nTop, nRight, nBottom);  
}  
};  
\_level0.zDragEnabled = true;

};  
//now, instead of using the built in ‘startDrag’ method, use the ‘newStartDrag’ method.  
// to toggle whether or not clips can be dragged, simply set ‘zDragEnabled’ to true or false.

Jeremy

---

<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:** [April 18, 2003, 4:32pm UTC](https://forum.kirupa.com/t/disable-startdrag/18469/4 "2003-04-18T16:32:51Z")

</div>

Hi sinfiniti,

I hate to ask a stupid question but I’m still kind of new to this stuff so please bear with me.

Are you suggesting that the code be inserted as is? Or do I have to change some of those references? Like mcRef - I’m assuming I need to sub that with my movie clip instance name? What about the others? Sorry if these are obvious to everyone else . . .

Next stupid question . . . where does this code go? On the movie clip that contains the drag button (current startDrag is on this button)? Or in a more general place?

Thanks . . .
