 							"return func.apply(func['this'], args);"
 						);
 					} as Function;
-					_jsonLookup[func] = value;
-					_jsonLookup[value] = func;
-					return func as Function;
-				}
-			}
+					_jsonLookup[func] = id;
+					_jsonLookup[id] = func;
+					value = func as Function;
+				}
+			}
+			for each (var extension:Function in _jsonReviverExtensions)
+				value = extension(key, value);
 			return value;
+		}
+		
+		/**
+		 * Extends JavaScript JSON communication to support new types of objects passed between ActionScript and JavaScript.
+		 * This only extends the ActionScript side. Corresponding JavaScript code must written if specialized JavaScript
+		 * Objects are to be supported.
+		 * @param replacer function(key:String, value:*):* ; Replaces an Object with a JSON-serializable representation. 
+		 * @param reviver function(key:String, value:*):* ; Revives an Object from its JSON representation.
+		 * 
+		 * @example Example JavaScript code (func1 and func2 should be function definitions)
+		 * <listing version="3.0">
+		 * JavaScript.exec(
+		 *     {"JSON_EXTENSIONS": JavaScript.JSON_EXTENSIONS},
+		 *     'this[JSON_EXTENSIONS].push({"replacer": func1, "reviver": func2});'
+		 * );
+		 * </listing>
+		 */
+		public static function extendJson(replacer:Function, reviver:Function):void
+		{
+			if (replacer != null)
+				_jsonReplacerExtensions.push(replacer);
+			if (reviver != null)
+				_jsonReviverExtensions.push(reviver);
 		}
 		
 		/**

		private static const JSON_CALL:String = "_jsonCall";
		
		/**
		 * Used as the second parameter to JSON.stringify
		 */
		private static const JSON_REPLACER:String = "_jsonReplacer";

		 * This flag will be set to true whenever _jsonReplacer makes a replacement that requires _jsonReviver to interpret.
		 */
		private static var _needsReviving:Boolean = false;
		
		/**
		 * Extensions to _jsonReplacer.
		 */
		private static const _jsonReplacerExtensions:Array = [];
		
		/**
		 * Extensions to _jsonReviver.
		 */
		private static const _jsonReviverExtensions:Array = [];
		
		/**
		 * Alias for ExternalInterface.available
