Disable startDrag?

: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?

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

 
_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?!

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


// 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

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 . . .