 						if (key == 'this')
 						{
 							// put a variable declaration at the beginning of the code
-							var thisVar:String = String(value);
+							var thisVar:String = value as String;
 							if (thisVar)
-								code.unshift(JS_var_this(thisVar));
+							{
+								if (!_objectID)
+									getExternalObjectID(thisVar);
+								code.unshift("var " + thisVar + " = this;");
+							}
 						}
 						else if (key == 'catch')
 						{

		private static var _functionCounter:int = 0;
		
		/**
		 * Alias for ExternalInterface.available
		 * @see flash.external.ExternalInterface#available
		 */

					"    }",
					"    if (value === undefined || (typeof value === 'number' && !isFinite(value)))",
					"        return value + JSON_SUFFIX;",
					"    return Array.isArray(value) && !(value instanceof Array) ? [].concat(value) : value;",
					"};",
					
					"flash[JSON_REVIVER] = function(key, value) {",
