Packagecom.adobe.serialization.json
Classpublic final class JSON
InheritanceJSON Inheritance Object

This class provides encoding and decoding of the JSON format. Example usage: // create a JSON string from an internal object JSON.encode( myObject ); // read a JSON string into an internal object var myObject:Object = JSON.decode( jsonString );



Public Methods
 MethodDefined By
  
decode(s:String, strict:Boolean = true):*
[static] Decodes a JSON string into a native object.
JSON
  
encode(o:Object):String
[static] Encodes a object into a JSON string.
JSON
Method Detail
decode()method
public static function decode(s:String, strict:Boolean = true):*

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9.0

Decodes a JSON string into a native object.

Parameters

s:String — The JSON string representing the object
 
strict:Boolean (default = true) — Flag indicating if the decoder should strictly adhere to the JSON standard or not. The default of true throws errors if the format does not match the JSON syntax exactly. Pass false to allow for non-properly-formatted JSON strings to be decoded with more leniancy.

Returns
* — A native object as specified by s
encode()method 
public static function encode(o:Object):String

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9.0

Encodes a object into a JSON string.

Parameters

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

Returns
String — the JSON string representing o