# Detecting dropped movie clips with \_droptarget

**URL:** <https://forum.kirupa.com/t/detecting-dropped-movie-clips-with--droptarget/162216>\
**Category:** flash\
**Created:** [September 10, 2005, 10:20pm UTC](https://forum.kirupa.com/t/detecting-dropped-movie-clips-with--droptarget/162216 "2005-09-10T22:20:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keeper](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@keeper](https://forum.kirupa.com/u/keeper)\
**Post date:** [September 10, 2005, 10:20pm UTC](https://forum.kirupa.com/t/detecting-dropped-movie-clips-with--droptarget/162216/1 "2005-09-10T22:20:18Z")

</div>

Hi. Can anyone help me with the following code. I want to create a small quiz whereby the user drags images (different types of film shots) under their appropriate headings. I want the following ‘feedback’ for the user:

1. If the image is dragged under the correct heading (ie. in the correct target area), then the image will stay there and change its alpha settings to 50%.

2. If the image is dragged under the incorrect heading, then on release the image is returned to its starting position.

What works: dragging and return to original starting position

What doesn’t work: image staying in the correct target area, change in alpha settings once image is in (theoretically!) the correct target area.

Here is my code - am I missing a crucial line of the code? Any help would be greatly appreciated. Thanks.

on(press) {  
startDrag(this, false);  
swapDepths(100);  
}  
on(release) {  
stopDrag();  
//if the dragged object is on the  
//‘ms\_target\_mc’ area  
//leave the dragged object in this area  
//and change its alpha settings to 50%  
if (this.\_droptarget == “/ms\_target\_mc”) {  
//x and y values of the target area  
setProperty(this, \_x, 482.0);  
setProperty(this, \_y, 227.8);  
setProperty(this, \_alpha, 50);  
//if the dragged object is not on the  
//desired target area  
//return the object to its starting position  
} else {  
setProperty(this, \_x, 195.5);  
setProperty(this, \_y, 288.5);  
}  
}

PS: I’m using Flash MX 2004, Education edition
