 		}
 		
 		public function testRunStarted( description:IDescription ):void{
-		
+			// XML Socket in flexbuilder is expecting a startTestRun node at the begining of the results.
+			// it seems to use this to reset hte current results, and prepopulate the total number of tests
+			// however, in flexunit4, we are unable to determine the total number of tests before hand, so
+			// we are sending through an empty startTestRun node, so the reset can still happen.
+			sendResults("<startTestRun totalTestCount='0'  projectName='' contextName='' />");
 		}
 
 		public function testRunFinished( result:Result ):void {
 		
-			printHeader( result );
-			printResults(result);
+			// if we want to wait until all tests are finished before sending any results, 
+			// in this method we should first call printHeader, then printResults, then printFooter
+			// however, as we are now sending through results as they happen, we use this method only to call printFooter		
+			//printHeader( result );
+			//printResults(result);
 			printFooter( result );
 		}
 
 		public function testStarted( description:IDescription ):void {
+			// called before each test
 		}
 		
 		public function testFinished( description:IDescription ):void {
+			// called after each test
 			if(!lastFailedTest || description.displayName != lastFailedTest.displayName){
 				var desc:Descriptor = getDescriptorFromDescription(description);
 				sendResults("<testCase name='"+desc.method+"' testSuite='"+desc.suite+"'  status='"+SUCCESS+"'/>");

		}
	
		protected function printFooter( result:Result ):void {
			logger.warn(END_OF_TEST_RUN);
		}
	
		protected function sendResults(msg:String):void{

		 */

		private function getDescriptorFromDescription(description:IDescription ):Descriptor{
			// reads relavent data from descriptor
			var descriptor:Descriptor = new Descriptor();
			var descriptionArray:Array = description.displayName.split("::");
			descriptor.path = descriptionArray[0];
