 		}
 		Timer.setTimeout(this, runBare, 5);
 	}
-	
-	/**
-	 * begin asunit25 specific methods
-	 */
-	
-	private function createEmptyMovieClip(name:String, depth:Number):MovieClip {
-		if(depth==undefined || depth===null) depth = getNextHighestDepth();
-		return getContext().createEmptyMovieClip(name, depth);
-	}
-
-	private function createTextField(name:String, depth:Number, x:Number, y:Number, width:Number, height:Number):TextField {
-	    getContext().createTextField(name, depth, x, y, width, height);
-	    return TextField(getContext()[name]);
-	}
-
-	private function getNextHighestDepth():Number {
-		return getContext().getNextHighestDepth();
-	}
-
-	/*
-	 * This helper method will support the following method signatures:
-	 *
-	 * attachMovie(linkageId:String):MovieClip;
-	 * attachMovie(linkageId:String, initObject:Object):MovieClip;
-	 * attachMovie(linkageId:String, name:String, depth:Number):MovieClip;
-	 * attachMovie(linkageId:String, name:String, depth:Number, initObject:Object):MovieClip;
-	 *
-	 * @return
-	 * 	MovieClip
-	 */
- 	private function attachMovie():MovieClip {
- 		var linkageId:String = arguments[0];
- 		var name:String;
- 		var depth:Number;
- 		var initObj:Object = new Object();
-
-		switch(arguments.length) {
-			case 1 :
-			case 2 :
-				name = getValidName(getContext(), name);
-				depth = getValidDepth(getContext());
- 				initObj = arguments[1];
- 				break;
- 			case 3 :
- 			case 4 :
- 				name = arguments[1];
- 				depth = arguments[2];
- 				initObj = arguments[3];
- 				break;
-		}
-		return getContext().attachMovie(linkageId, name, depth, initObj);
- 	}
-
-	public function getUpperEmptyDepth(parent:MovieClip, depth:Number):Number {
-		if(depth == undefined || !isValidDepth(parent, depth)) {
-			var high:Number = (depth == undefined) ? 1 : depth;
-			for(var i:String in parent) {
-				if(parent[i] instanceof MovieClip && parent[i].getDepth() != undefined) {
-					high = Math.max(parent[i].getDepth()+1, high);
-				}
-			}
-			return high;
-		}
-		return depth;
-	}
-
-	private function getValidName(parent:MovieClip, nm:Object):String {
-		var incr:Number = 1;
-
-		var name:String = (nm == undefined || nm instanceof Object) ? "item" : nm.toString();
-		var ref:MovieClip = parent[name];
-
-		var name2:String = name;
-		while(ref != undefined && incr < 100) {
-			name2 = name + "-" + (incr++);
-			ref = parent[name2];
-		}
-		return name2;
-	}
-
-	private function isValidDepth(parent:MovieClip, depth:Number):Boolean {
-		var item:MovieClip = getItemByDepth(parent, depth);
-		return (item == null) ? true : false;
-	}
-
-	private function getItemByDepth(parent:MovieClip, depth:Number):MovieClip {
-		for(var i:String in parent) {
-			if(parent[i].getDepth() == depth) {
-				return parent[i];
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the next available depth for attaching a MovieClip.
-	 *
-	 * @return
-	 *         Number of next available depth.
-	 */
-	public static function nextDepth():Number {
-		return lastDepth++;
-	}
-
-	private function getValidDepth(mc:MovieClip):Number {
-		var mcDepth:Number;
-		var dp:Number = nextDepth();
-		for(var i:String in mc) {
-			mcDepth = mc[i].getDepth();
-			if(mc[i] instanceof MovieClip && mcDepth < 10000) {
-				dp = Math.max(mcDepth, dp);
-			}
-		}
-		return ++dp;
+	
+	/**
+	 * begin asunit25 specific methods
+	 */
+	
+	private function createEmptyMovieClip(name:String, depth:Number):MovieClip {
+	    if(name == null) name = getValidName(getContext());
+		if(depth == null) depth = getNextHighestDepth();
+		return getContext().createEmptyMovieClip(name, depth);
+	}
+
+	private function createTextField(name:String, depth:Number, x:Number, y:Number, width:Number, height:Number):TextField {
+	    getContext().createTextField(name, depth, x, y, width, height);
+	    return TextField(getContext()[name]);
+	}
+
+	private function getNextHighestDepth():Number {
+	    return getValidDepth(getContext());
+	}
+	
+	/*
+	 * This helper method will support the following method signatures:
+	 *
+	 * attachMovie(linkageId:String):MovieClip;
+	 * attachMovie(linkageId:String, initObject:Object):MovieClip;
+	 * attachMovie(linkageId:String, name:String, depth:Number):MovieClip;
+	 * attachMovie(linkageId:String, name:String, depth:Number, initObject:Object):MovieClip;
+	 *
+	 * @return
+	 * 	MovieClip
+	 */
+ 	private function attachMovie():MovieClip {
+ 		var linkageId:String = arguments[0];
+ 		var name:String;
+ 		var depth:Number;
+ 		var initObj:Object = new Object();
+
+		switch(arguments.length) {
+			case 1 :
+			case 2 :
+				name = getValidName(getContext(), name);
+				depth = getValidDepth(getContext());
+ 				initObj = arguments[1];
+ 				break;
+ 			case 3 :
+ 			case 4 :
+ 				name = arguments[1];
+ 				depth = arguments[2];
+ 				initObj = arguments[3];
+ 				break;
+		}
+		return getContext().attachMovie(linkageId, name, depth, initObj);
+ 	}
+
+	private function getValidName(parent:MovieClip, nm:Object):String {
+		var incr:Number = 1;
+
+		var name:String = (nm == undefined || nm instanceof Object) ? "item" : nm.toString();
+		var ref:MovieClip = parent[name];
+
+		var name2:String = name;
+		while(ref != undefined && incr < 100) {
+			name2 = name + "-" + (incr++);
+			ref = parent[name2];
+		}
+		return name2;
+	}
+
+	/**
+	 * Returns the next available depth for attaching a MovieClip.
+	 *
+	 * @return
+	 *         Number of next available depth.
+	 */
+	public static function nextDepth():Number {
+		return lastDepth++;
+	}
+
+	private function getValidDepth(mc:MovieClip):Number {
+		var mcDepth:Number;
+		var dp:Number = nextDepth();
+		for(var i:String in mc) {
+			mcDepth = mc[i].getDepth();
+			if(mc[i] instanceof MovieClip && mcDepth < 10000) {
+				dp = Math.max(mcDepth, dp);
+			}
+		}
+		return ++dp;
 	}
 
 }

	private var methodIterator:Iterator;
	private var layoutManager:Object;
	private var currentState:Number;

	private static var lastDepth:Number = 10;

	/**
	 * Constructs a test case with the given name.
	 */
	public function TestCase(testMethod:String) {
		if(testMethod==undefined) testMethod=null;
		if(testMethod != null) {
			testMethods = testMethod.split(", ").join(",").split(",");

	 * Sets the name of a TestCase
	 * @param name The name to set
	 */
	public function setName(name:String):Void {
		if(name==undefined || name==null){
			throw new ClassNameUndefinedError("You must assign a ClassName for your TestCase subclass.")
		}
		fName = name;
	}

	private function setTestMethods(obj:Object):Void {
		testMethods = [];
		_global.ASSetPropFlags(obj.__proto__, null, 6, true);
		for(var prop:String in obj) {
				// look for functions starting with "test"
			if((prop.indexOf("test")==0)  && (obj[prop] instanceof Function)){
				testMethods.push(prop);
			}
		}
		_global.ASSetPropFlags(this.__proto__, null, 1, true);
		testMethods.reverse();		
	}
	
