Whiteybags
Technical User
Hi,
I'm trying to do drag & drop. I have the drag working. I'm getting the feedback from trace letting me know when my movie clips hit the targets & which ones.
I cannot get my movie clips to snap back to the original position if they do not hit a target. That is what I'm trying to find out.
I have a movie clip (clip1) and a button within the movie clip. My target areas are numbered 1 to 4 (target1). The following code is on the button.
on (press) {
this.startDrag (false);
}
on (release) {
this.stopDrag();
if (_root.clip1._droptarget == "/target1") {
trace ("clip 1 in target 1");
}
if (_root.clip1._droptarget == "/target2") {
trace ("clip 1 in target 2");
}
if (_root.clip1._droptarget == "/target3") {
trace ("clip 1 in target 3");
}
if (_root.clip1._droptarget == "/target4") {
trace ("clip 1 in target 4");
}
else {
this_y= OrgY;
this_x= OrgX;
}
}
Please help
I'm trying to do drag & drop. I have the drag working. I'm getting the feedback from trace letting me know when my movie clips hit the targets & which ones.
I cannot get my movie clips to snap back to the original position if they do not hit a target. That is what I'm trying to find out.
I have a movie clip (clip1) and a button within the movie clip. My target areas are numbered 1 to 4 (target1). The following code is on the button.
on (press) {
this.startDrag (false);
}
on (release) {
this.stopDrag();
if (_root.clip1._droptarget == "/target1") {
trace ("clip 1 in target 1");
}
if (_root.clip1._droptarget == "/target2") {
trace ("clip 1 in target 2");
}
if (_root.clip1._droptarget == "/target3") {
trace ("clip 1 in target 3");
}
if (_root.clip1._droptarget == "/target4") {
trace ("clip 1 in target 4");
}
else {
this_y= OrgY;
this_x= OrgX;
}
}
Please help