PDA

View Full Version : Droptargets: what am I doing wrong?


DigiScript
01-23-2001, 03:21 PM
Ok, I am new to ActionScripting so this is probably something stupid I am doing wrong. I did the Drag n Drop tutorial, but when I add the _droptarget command, the StopDrag stops working. The startDrag and stopDrag work fine by themselves, but as soon as I add a _droptarget, the object I am dragging sticks to the mouse until you click again, instead of stopDragging on release as specified.
Any help?

on (press) {
startDrag (this, true);
}
on (release) {
stopDrag ();
if (this._droptarget == "/target") {
_root.target.gotoAndPlay(2);
}
}

Thanks in Advance

Jesse
01-23-2001, 11:35 PM
There's nothing wrong with that code (that I can see). Assuming your target clip is called "target" (instance name), and it lives on the main stage, it should work fine....

Cheers

Jesse

DigiScript
01-24-2001, 09:32 PM
The drop action works if I can get the thing off my mouse, but it still sticks, requiring an extra click (or 2 or 3) to get the MC to quit dragging.... could it be a bug?

Jesse
01-25-2001, 05:02 AM
It's not likely to be an error in your code but I got my example working fine so it aint a bug either. Does you button have any other On events on it? That could be confusing things...

Cheers

Jesse

mgb
01-28-2001, 10:14 PM
If you drag outside the movie area this can often happen. Do you have constraints on the drag action?

mgb