 			else
 				ErrorManager.reportError(e);
 		}
-		
-		/**
-		 * @private
-		 */
-		private static function generateExternalInterfaceCallback(instance:Object, methodInfo:Object):void
-		{
-			var method:Function = instance[methodInfo.name] as Function;
-			// find the number of required parameters
-			var paramCount:int = 0;
-			while (paramCount < method.length && !methodInfo.parameters[paramCount].optional)
-				paramCount++;
-			function callback(...args):*
-			{
-				if (args.length < paramCount)
-					args.length = paramCount;
-				return method.apply(null, args);
-			}
-			ExternalInterface.addCallback(methodInfo.name, callback);
-		}
-		
 		
 		/**************************************/
 		

			// concatenate all code inside a function wrapper
			code = 'function(' + pNames.join(',') + '){\n' + code + '}';
			
			// if there are no parameters, just run the code
			if (pNames.length == 0)
				return ExternalInterface.call(code);

				{
					var instance:Object = getSingletonInstance(theInterface);
					var classInfo:Object = describeTypeJSON(theInterface, DescribeType.INCLUDE_TRAITS | DescribeType.INCLUDE_METHODS | DescribeType.HIDE_NSURI_METHODS | DescribeType.USE_ITRAITS);
					// register each external interface function
					for each (var methodInfo:Object in classInfo.traits.methods)
						new ExternalMethod(instance, methodInfo);
				}

				var prev:Boolean = ExternalInterface.marshallExceptions;
