# Need help Creating 1 drag for Multiple drops. - Will Pay!

**URL:** <https://forum.kirupa.com/t/need-help-creating-1-drag-for-multiple-drops-will-pay/202912>\
**Category:** flash\
**Created:** [October 5, 2006, 7:29pm UTC](https://forum.kirupa.com/t/need-help-creating-1-drag-for-multiple-drops-will-pay/202912 "2006-10-05T19:29:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie133](https://avatars.discourse-cdn.com/v4/letter/n/aca169/32.png) [@newbie133](https://forum.kirupa.com/u/newbie133)\
**Post date:** [October 5, 2006, 7:29pm UTC](https://forum.kirupa.com/t/need-help-creating-1-drag-for-multiple-drops-will-pay/202912/1 "2006-10-05T19:29:45Z")

</div>

[COLOR=black][FONT=Verdana]Need help Creating 1 drag for Multiple drops. Example of code below.

I want to drag fruit into multiple (targets) containers that lock. Fruit can have multiple correct targets. I can this to work 1-on-1 but not multiple. Thanks!

* * *

// Create 1 drag for Mutiple drop functionality

fruit\_mc.onPress = function() {  
this.startDrag();  
};  
fruit\_mc.onRelease = function() {  
this.stopDrag();  
if (this.hitTest(\_root.fruit\_targ\_mc)) {  
this.\_x=555.6;  
this.\_y=123.5;  
\_root.drag\_txt.htmlText = “\<b\>Correct!”;

} else if (this.hitTest(\_root.start\_targ\_mc)) {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
} else {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
}  
};

fruit\_mc.onPress = function() {  
this.startDrag();  
};  
fruit\_mc.onRelease = function() {  
this.stopDrag();  
if (this.hitTest(\_root.apple\_targ\_mc)) {  
this.\_x=555.6;  
this.\_y=123.5;  
\_root.drag\_txt.htmlText = “\<b\>Correct!”;

} else if (this.hitTest(\_root.start\_targ\_mc)) {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
} else {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
}  
};

fruit\_mc.onPress = function() {  
this.startDrag();  
};  
fruit\_mc.onRelease = function() {  
this.stopDrag();  
if (this.hitTest(\_root.chair\_targ\_mc)) {  
this.\_x=555.6;  
this.\_y=123.5;  
\_root.drag\_txt.htmlText = “\<b\>Correct!”;

} else if (this.hitTest(\_root.start\_targ\_mc)) {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
} else {  
this.\_x=556.6;  
this.\_y=302.4;  
\_root.drag\_txt.htmlText = “\<b\>Incorrect\</b\>\<br\>Please Try again!”;  
}  
};[/FONT][/COLOR]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
