PDA

View Full Version : Drag error


smatmx
02-21-2005, 05:13 AM
There is something wrong with my drag function in my animation. When I drag it, it sticks onto the mouse. When I command it to stopDrag in the actionscript. Can anybody give me any clue to how?

THANK YOU! :o

tGP
02-21-2005, 07:29 PM
you need to tell startDrag to begin on mouseDown, and stopDrag to begin on MouseUp

post the code you have so far if you have further problems.

cheers
j

senocular
02-21-2005, 07:40 PM
note that onRelease is not the same as onMouseUp. The problem with the sticking is because you released the mouse button before the dragging clip was able to catch up with the mouse meaning that the release was not over the clip. This is actually interpreted as an onReleaseOutside event as opposed to onRelease. You can instead use onMouseUp witch is when the mouse is released anywhere (over the object or not) or simply use onRelease and onReleaseOutside for such occurances.

smatmx
02-24-2005, 01:26 PM
Thanks very much to you guys!

I'll try. ;)

smatmx
02-24-2005, 01:45 PM
It's still doesn't work, this is my code, quite simple:
on (press) {
startDrag(this);
}
onMouseUp {
stopDrag(this);
}

can anybody help me? :confused:

Thanks for any help.

senocular
02-24-2005, 02:01 PM
onMouseUp isnt an event you can apply to buttons like that. Use
on (release, releaseOutside){

smatmx
03-09-2005, 05:09 AM
It still sticks to my mouse :( , this is my code:

on (press) {
startDrag(this);
}
on (release, releaseOutside) {
stopDrag
}


Can anybody please help me, Thank you you!! :)