# Detection of \_droptargets

**URL:** <https://forum.kirupa.com/t/detection-of--droptargets/2619>\
**Category:** flash\
**Created:** [May 23, 2002, 8:23am UTC](https://forum.kirupa.com/t/detection-of--droptargets/2619 "2002-05-23T08:23:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 23, 2002, 8:23am UTC](https://forum.kirupa.com/t/detection-of--droptargets/2619/1 "2002-05-23T08:23:59Z")

</div>

Is there a way of telling a null value in the \_droptarget property?

Basically I’ve got 9 draggable objects, and what I want them to do is if there is no \_droptarget when you release the drag, flick back to it’s riginal position.

- Kit

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 23, 2002, 12:19pm UTC](https://forum.kirupa.com/t/detection-of--droptargets/2619/2 "2002-05-23T12:19:21Z")

</div>

just use if/else statements. Remember that \_droptarget returns “/target”.

let me know if you need additional help. Here is a sample:

on(press){  
&nbsp &nbsp &nbsp &nbsp this.startdrag();  
}  
on(release){  
&nbsp &nbsp &nbsp &nbsp this.stopdrag();  
&nbsp &nbsp &nbsp &nbsp drop=this.\_droptarget;  
&nbsp &nbsp &nbsp &nbsp if(drop=="/redsquare"){  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_x=413.5;  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_y=121.0;  
&nbsp &nbsp &nbsp &nbsp } else if(drop=="/bluesquare"){  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_x=413.5;  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_y=240.3;  
&nbsp &nbsp &nbsp &nbsp } else {  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_x=170;  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.\_y=170;  
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp }  
}

“My name is Inigo Montoya. You killed my father. Prepare to die!”

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 23, 2002, 12:51pm UTC](https://forum.kirupa.com/t/detection-of--droptargets/2619/3 "2002-05-23T12:51:28Z")

</div>

Cheers. Just checked it against my own code, and I’d missed out a this. along the way. Argh. Don’t you just hate it when that happens?
