# Drag n Drop Target Issue

**URL:** <https://forum.kirupa.com/t/drag-n-drop-target-issue/47074>\
**Category:** flash\
**Created:** [March 30, 2004, 8:54pm UTC](https://forum.kirupa.com/t/drag-n-drop-target-issue/47074 "2004-03-30T20:54:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![colin\_ferguson](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@colin\_ferguson](https://forum.kirupa.com/u/colin_ferguson)\
**Post date:** [March 30, 2004, 8:54pm UTC](https://forum.kirupa.com/t/drag-n-drop-target-issue/47074/1 "2004-03-30T20:54:15Z")

</div>

I have a drag n drop issue.

I have a shape that I want to drag and drop on a target.

Everything works OK if I place the item to be dragged on the main timeline.

My problem is when I put the items within a Movie, the draging still works, but for some reason it no longer recognizes the drop target. :trout:

Here is the Code:

views\_mc.onPress = function() {  
startDrag(this);  
};  
views\_mc.onRelease = views\_mc.onReleaseOutside=function () { stopDrag();if (this.\_droptarget == “/targetViews”) {this.onTarget = true;\_root.targetViews.gotoAndStop(2);} else {this.onTarget = false;\_root.targetViews.gotoAndStop(1);}};  
views\_mc.onLoad = function() {  
viewsHomeX = 40;  
viewsHomeY = 408;  
viewsFinalX = 748;  
viewsFinalY = 492;  
};  
views\_mc.onMouseDown = function() {  
mousePressed = true;  
};  
views\_mc.onMouseUp = function() {  
mousePressed = false;  
};  
views\_mc.onEnterFrame = function() {  
if (mousePressed == false && this.onTarget == false) {  
views\_mc.\_x -= (this.\_x-viewsHomeX)/5;  
views\_mc.\_y -= (this.\_y-viewsHomeY)/5;  
} else if (mousePressed == false && this.onTarget == true) {  
views\_mc.\_x -= (this.\_x-viewsFinalX)/5;  
views\_mc.\_y -= (this.\_y-viewsFinalY)/5;  
c = “1”;  
if (a == “1” and b == “1” and c == “1”) {  
setProperty(“congrats”, \_visible, “1”);  
} else {  
setProperty(“congrats”, \_visible, “0”);  
}  
}  
};

I have searched for this answer but cannot find. Any help appreciated.
