Class com.sekati.data.JSON

Description

JSON (JavaScript Object Notation) Serializing/Deserializing Parser.

 Usage:
 var JSONObj:Object = {unlucky:13, lucky:7, household:{ people:["Jason","Therese"], pets:["Finn","Van"] }, colors:{ black:0x000000, white:0xFFFFFF, red:0xFF0000 }};
 var s:String = JSON.stringify(JSONObj);
 var o:Object = JSON.parse(s);
 trace (JSON.$+" stringified: " + s);
 trace (JSON.$+" objectified: "+o);

See Also

Field Index

$

Method Index

getInstance(), parse(), stringify()

Inherited from CoreObject

Field Detail

$

static public $:JSON [Read Only]
Shorthand Singleton accessor getter

Method Detail

getInstance

static public function getInstance():JSON

Singleton Accessor

Return

JSON

stringify

static function stringify(arg:Object):String

Transform an actionscript object to a JSON string

Parameters

arg(Object) The object to jsonize

Return

String - The JSON string

parse

static public function parse(text:String):Object

Parse a JSON string and return an ActionScript object

Parameters

text(String) The string to parse

Return

Object - The outputted ActionScript object