Swapdepth()

I’ve been trying to attach a swapdepth() to this script so that the txt is arranged ontop of the MC but with no luck…Does anyone know what I need to do?

Here’s the code:


//************************
var str:String = "This is a String";
var strSplit:Array = str.split("");
for (var i = 0; i<strSplit.length; i++) {
	if (strSplit* != ' ') {
		this.createEmptyMovieClip("text"+i, this.getNextHighestDepth());
		//this.createEmptyMovieClip("textAlpha"+i, this.getNextHighestDepth());
		_root["text"+i].createTextField("txt", 1, 5, 5, 20, 20);
		_root["text"+i].txt.text = strSplit*;
		_root["text"+i]._x = _root["text"+i]._x+15*i;
		_root["text"+i].txt.type = "static";
		_root["text"+i].onPress = function() {
			this.startDrag();
		};
		_root["text"+i].onRelease = function() {
			this.stopDrag();
			theDrop=eval(this._droptarget);
			trace(theDrop.myLetter);
			if(theDrop.myLetter==this.txt.text){
				trace('match!');
			}
		};
		this.attachMovie('drop','drop'+i,this.getNextHighestDepth());
		_root["drop"+i]._x=100+(i*25);
		_root["drop"+i]._y=300;
		_root["drop"+i].myLetter=strSplit*;
		
		
	}
}
//************************

I’d be very grateful for a good nudge in the right direction! :esmirk:

Yossi