# Drag and drop

**URL:** <https://forum.kirupa.com/t/drag-and-drop/286298>\
**Category:** Uncategorized\
**Created:** [April 13, 2009, 2:20pm UTC](https://forum.kirupa.com/t/drag-and-drop/286298 "2009-04-13T14:20:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmoore](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rmoore](https://forum.kirupa.com/u/rmoore)\
**Post date:** [April 13, 2009, 2:20pm UTC](https://forum.kirupa.com/t/drag-and-drop/286298/1 "2009-04-13T14:20:16Z")

</div>

I have a draggable movie clip that contains a button inside to hold my code. The target area is in the root and is a movie clip. I need to be able to drag and drop on the target. When it does drop on the target it needs to play a different keyframe from the root which holds a movie clip. Below is the code I have in my button within the draggable movie:

on(press) {  
startDrag(this,true);  
}  
on(release) {  
stopDrag();  
if(eval(this.\_droptarget) != \_root.bartarget) {  
\_x = 465;  
\_y = 196;  
} else {  
\_root.gotoAndPlay(“bardrop”);}  
}

it starts dragging, but for some reason the drop target isn’t working or the stopDrag, because it won’t stop dragging. Any suggestions?
