-
Notifications
You must be signed in to change notification settings - Fork 26
JSONer
Nick Ryzhy edited this page Apr 25, 2016
·
1 revision
The JSONer
class lets applications import and export data using JavaScript Object Notation (JSON) format.
Name | Value |
---|---|
Package | by.blooddy.crypto.serialization |
Name | final class JSONer |
Inheritance |
JSONer → Process → EventDispatcher → Object
|
import by.blooddy.crypto.serialization.JSONer;
var result:Object = JSONer.parse( '{o:0}' );
import by.blooddy.crypto.serialization.JSONer;
import by.blooddy.crypto.events.ProcessEvent;
var json:JSONer = new JSONer();
json.parse( '{o:0}' );
json.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
var Object = event.data;
trace( result ); // async result
} );
json.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
var error:Error = event.data;
trace( error ); // async error
} );
Name | Description |
---|---|
stringify(value:*):String |
Returns a String , in JSON format, that represents an ActionScript value. Used native JSON.stringify , if possible. |
parse(value:String):* |
Accepts a JSON-formatted String and returns an ActionScript Object that represents that value. Used native JSON.parse , if possible. |
Name | Description |
---|---|
JSON() |
Creates a JSON object. |
Name | Description |
---|---|
stringify(value:*):void |
Asynchronously returns a String , in JSON format, that represents an ActionScript value. Dispatched JSON string in ProcessEvent . |
parse(value:String):void |
Asynchronously accepts a JSON-formatted String and returns an ActionScript Object that represents that value. Dispatched ActionScript Object in ProcessEvent .value. |
Name | Type | Description |
---|---|---|
complete |
ProcessEvent | Dispatched when success. |
error |
ProcessEvent | Dispatched when fault. |