This page describes an older version, please see latest API at http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/utils/JSON.html.
Packagecom.esri.ags.utils
Classpublic class JSON
InheritanceJSON Inheritance Object

Generic class for encoding in to and decoding out of JSON strings.



Public Methods
 MethodDefined By
  
decode(string:String):*
[static] Decodes a JSON string into a Flex object.
JSON
  
encode(object:Object):String
[static] Encodes a Flex object into a JSON string.
JSON
Method Detail
decode()method
public static function decode(string:String):*

Decodes a JSON string into a Flex object.

Parameters

string:String — The JSON string representing the object.

Returns
* — A native object.

Throws
Error — If input string cannot be parsed.
encode()method 
public static function encode(object:Object):String

Encodes a Flex object into a JSON string. Note that for a graphic, convertToJSON will convert attributes and geometry, but not the symbol.

Parameters

object:Object — The object to create a JSON string for.

Returns
String — the JSON string representing the object.