PDA

View Full Version : drag count revisted


baileyboop
03-10-2002, 01:07 PM
Billy T, Thanks! Your code calls the message array from the dragCount...*perfect* Thank YOU!

If they drag it over the target would that code go in as an else if? or another "if" statement on the existing "if" in the button release code? If the dragged clip is dropped on it's target I need it to stop drag and the message to be different than that in the array.

Attached is the ORIGINAL file Billy T sent. Thanks so much for the help~! Below is my "else if" that does NOT work :(

Have-a-looksee if you can help and want to. Thanks all!!!

-boopy

// Billy T's code that works great!
on (press) {
if (_root.dragCount<4) {
this.startDrag();
_root.dragCount++;

}
}
on (release) {
stopDrag ();
if (eval(_droptarget) != _parent.dragHere) {
_x = home_x;
_y = home_y;
_root.DisMessage = _root.message[_root.dragCount];

}

// my added code that doesn't work :(

else if (eval(this._droptarget) == eval("_parent."+this._name+"Here")) {
this._x = eval(this._droptarget)._x;
this._y = eval(this._droptarget)._y;
_root.Dismessage = "good job!";
}

}:confused:

Billy T
03-10-2002, 03:08 PM
should just be something like

on (press) {
if (_root.dragCount<4) {
this.startDrag();
_root.dragCount++;

}
}
on (release) {
stopDrag ();
if (eval(_droptarget) != _parent.dragHere) {
_x = home_x;
_y = home_y;
_root.DisMessage = _root.message[_root.dragCount];

}else{
this._x = eval(this._droptarget)._x;
this._y = eval(this._droptarget)._y;
_root.DisMessage = "good job!";
}
}

cheers

baileyboop
03-10-2002, 03:26 PM
Thanks Billy T. You've saved me a LOT of headaches :D

cheers

-boopy