 internal class ExternalMethod
 {
 	/**
+	 * A wrapper for ExternalInterface.call() that properly escapes backslashes.
+	 */
+	public static function fixed_ExternalInterface_call(code:String):*
+	{
+		if (!initialized)
+			initialize();
+		if (codeBackslashNeedsEscaping)
+			code = code.split('\\').join('\\\\');
+		return ExternalInterface.call(code);
+	}
+	
+	private static function initialize():void
+	{
+		// one-time initialization attempt
+		initialized = true;
+		codeBackslashNeedsEscaping = (ExternalInterface.call('function(){ return "\\\\\\\\"; }') == "\\");
+		try
+		{
+			json = getDefinitionByName("JSON");
+			ExternalInterface.addCallback(JSON_CALL, handleJsonCall);
+			WeaveAPI.executeJavaScript(
+				{
+					"JSON_REPLACER": JSON_REPLACER,
+					"JSON_REVIVER": JSON_REVIVER,
+					"NOT_A_NUMBER": NOT_A_NUMBER,
+					"UNDEFINED": UNDEFINED,
+					"INFINITY": INFINITY,
+					"NEGATIVE_INFINITY": NEGATIVE_INFINITY
+				},
+				"weave[JSON_REPLACER] = function(key, value){",
+				"    if (value === undefined)",
+				"        return UNDEFINED;",
+				"    if (typeof value != 'number' || isFinite(value))",
+				"        return value;",
+				"    if (value == Infinity)",
+				"        return INFINITY;",
+				"    if (value == -Infinity)",
+				"        return NEGATIVE_INFINITY;",
+				"    return NOT_A_NUMBER;",
+				"};",
+				"weave[JSON_REVIVER] = function(key, value){",
+				"    if (value === NOT_A_NUMBER)",
+				"        return NaN;",
+				"    if (value === UNDEFINED)",
+				"        return undefined;",
+				"    if (value === INFINITY)",
+				"        return Infinity;",
+				"    if (value === NEGATIVE_INFINITY)",
+				"        return -Infinity;",
+				"    return value;",
+				"};"
+			);
+		}
+		catch (e:Error)
+		{
+			trace(e.getStackTrace() || "Your version of Flash Player does not have native JSON support.");
+		}
+	}
+	
+	/**
 	 * This is set to true when the initialization code has been attempted.
 	 */
 	private static var initialized:Boolean = false;
+	
+	/**
+	 * If this is true, then ExternalInterface.call() does not properly quote backslashes in the code.
+	 */
+	private static var codeBackslashNeedsEscaping:Boolean = false;
+	
+	/**
+	 * If this is true, backslashes are not properly escaped in results from external ActionScript invocations.
+	 */
+	private static var resultBackslashNeedsEscaping:Boolean = true;
 	
 	/**
 	 * A pointer to JSON.

		var resultJson:String = json.stringify(result, _jsonReplacer);
		
		// work around bug where ExternalInterface does not escape backslash.
		resultJson = resultJson.split('\\').join('\\\\');

		return resultJson;
	}

	public function ExternalMethod(host:Object, methodInfo:Object)
	{
		if (!initialized)
			initialize();
		
		// backwards compatibility
		if (!json)
