FORUMS: list search recent posts

stopDrag is not stop drag?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Renderwise
stopDrag is not stop drag?
on Jan 12, 2006 at 7:27:23 pm

Hi!

Is it possible to turn off the drag-function for a movieclip? After the movieclip is postioned at the right place I want the drag-function to be turned of. And all have to work in the same frame(else, it would be easy to just move the playhead and "fake")As it is now one can press and drag the clip again after it have been droped and placed and stopDrag have been executed, I am using the script below, the drag and drop works as it should. But how do I change the code to make it work as wanted?
(Flash 8 Pro, OSX 10.4, G5 dual 2,5, 2gb RAM)
Thanks

circle_mc.onPress = function(){
this.startDrag();
};
circle_mc.onRelease = circle_mc.onReleaseOutside = function(){
this.stopDrag();
if (eval(this._droptarget) == circleBig_mc) {
status_mc.gotoAndPlay ("correct");
} else {
this._x = 112;
this._y = 316;
}
};


Return to posts index

Matt Klundt
Re: stopDrag is not stop drag?
on Jan 12, 2006 at 8:31:44 pm

Add circle_mc.onPress = null; to the code like so:

circle_mc.onPress = function(){
this.startDrag();
};
circle_mc.onRelease = circle_mc.onReleaseOutside = function(){
this.stopDrag();
if (eval(this._droptarget) == circleBig_mc) {
circle_mc.onPress = null;
status_mc.gotoAndPlay ("correct");
} else {
this._x = 112;
this._y = 316;
}
};

Matt
--------------------
http://www.mcquillendesign.com
http://www.mattfoxgames.com


Return to posts index

Renderwise
Re: stopDrag is not stop drag?
on Jan 12, 2006 at 9:10:23 pm

Thanks! It works! But I forgot to ask if one also can turn off the possibility to click(press, release) when the movieclip have been droped?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]