# Drag and Drop \*DEBUG\* Please Help!

**URL:** https://forum.kirupa.com/t/drag-and-drop-debug-please-help/190367
**Category:** flash
**Created:** [June 11, 2006, 12:59am UTC](https://forum.kirupa.com/t/drag-and-drop-debug-please-help/190367 "2006-06-11T00:59:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chalemi](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@chalemi](https://forum.kirupa.com/u/chalemi)
#### Post date: [June 11, 2006, 12:59am UTC](https://forum.kirupa.com/t/drag-and-drop-debug-please-help/190367/1 "2006-06-11T00:59:43Z")

</div>

ok all of this code is working, except for the close.\_btn action

can someone help??

here is the code:  
[AS]import mx.transitions.Tween;  
import mx.transitions.easing.\*;  
function checkit():Void {  
var inde:Number = 0;  
for (i=1; i\<=6; i++) {  
this[“mc”+i].onTarget ? animout(this[“mc”+i]) : inde++;  
}  
}  
function animout(mc:MovieClip):Void {  
new Tween(mc, “\_x”, Strong.easeOut, mc.\_x, mc.myHomeX, 25);  
new Tween(mc, “\_y”, Strong.easeOut, mc.\_y, mc.myHomeY, 25);  
}  
for (i=1; i\<=6; i++) {  
this[“mc”+i].ind = i;  
this[“mc”+i].onPress = function() {  
startDrag(this);  
this.shadow\_mc.\_alpha = 100;  
this.beingDragged = true;

```
};
this["mc"+i].onRelease = this["mc"+i].onReleaseOutside=function () {
	this.stopDrag();
	this.beingDragged = false;
	if (eval(this._droptarget) == targ_mc) {
		checkit();
		this.onTarget = true;
		projectHolder.attachMovie(this._name, "project", 1);
		this.swapDepths (projectHolder);
		maintext._alpha = 0;
		this.shadow_mc._alpha = 0;
	} else {
		animout(this);
		this.onTarget = false;
	}
};
this["mc"+i].myHomeX = this["mc"+i]._x;
this["mc"+i].myHomeY = this["mc"+i]._y;

```

}  
close\_btn.onRelease = function() {  
projectHolder.unloadMovie();  
maintext.\_alpha=100;  
for (i=1; i\<=4; i++) {  
animout(\_root[“mc”+i]);  
\_root[“mc”+i].onTarget = false;  
};

}[/AS]

Here is the error message I receive:

```auto
**Error** Scene=main, layer=actions, frame=1:Line 68: Syntax error.
             animout(_root["mc"+i]);

**Error** Scene=main, layer=actions, frame=1:Line 69: Syntax error.
             _root["mc"+i].onTarget = false;

**Error** Scene=main, layer=actions, frame=1:Line 70: Unexpected '}' encountered
     	};

Total ActionScript Errors: 3 Reported Errors: 3

```

anyone?:sigh:
