# Drag&Drop not working when imported

**URL:** <https://forum.kirupa.com/t/drag-drop-not-working-when-imported/233615>\
**Category:** flash\
**Created:** [July 25, 2007, 2:07pm UTC](https://forum.kirupa.com/t/drag-drop-not-working-when-imported/233615 "2007-07-25T14:07:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Largo](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@Largo](https://forum.kirupa.com/u/Largo)\
**Post date:** [July 25, 2007, 2:07pm UTC](https://forum.kirupa.com/t/drag-drop-not-working-when-imported/233615/1 "2007-07-25T14:07:24Z")

</div>

Hi, I have a Drag&Drop game that works perfectly when viewed alone, but when I import it through a master SWF it wont work. You can drag the items but when you release them on the right droptarget they are all sent back. It´s like it doesn´t recognize the droptargets I think, but Im not sure…[COLOR=slategray]_(Take a look at the Zip for .fla & .swf_)[/COLOR]

**Here the two SWF´s:**

_I have two MC´s called “dt1” and “dt2” which are the droptargets, and six drag items._  
[COLOR=red]This is on the first frame in the D&D game:[/COLOR]

```auto
var xpos:Number;
var ypos:Number;
function checkMyPos(obj, num) {
 if ((obj._droptarget) !== "/"+"dt"+num) {
  obj._x = xpos;
  obj._y = ypos;
 } else {
  obj.enabled = false;
 }
}

```

[COLOR=#ff0000]This is on each drag item in the D&D:[/COLOR]

```auto
on(press){
  this.swapDepths(_parent.getNextHighestDepth());
  _parent.xpos = this._x;
  _parent.ypos = this._y;
  this.startDrag();
 }
on(release){
  this.stopDrag();
  _parent.checkMyPos(this, 1);
}

```

[COLOR=#ff0000]This is my master SWF script on the first frame:[/COLOR]  
_I have one MC called “container\_mc” that loads the SWF._

```auto
 
function onLoadProgress(target, bytes_loaded, bytes_total) {
 target.stop();
 target._visible = false;
}
function onLoadComplete(target) {
 target.play();
 target._visible = true;
}
var loader_mcl = new MovieClipLoader();
loader_mcl.addListener(this);
function startPreload(url) {
 loader_mcl.loadClip(url,container_mc);
}
startPreload("dd.swf");

```

**Can anyone help me?🙂**
