Skip to content

This class helps the AS# developers to serialize complex typed objects and return the object to the original structure.

Notifications You must be signed in to change notification settings

filiperp/AS3_Serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[AS3_Serializer]

explain

This class helps the AS# developers to serialize complex typed objects and return the object to the original structure.

example:

Consider this class:

public class Person {
	public var eye:Eye;
	public var born :Date;
	public var extas:Object;
	public var relatives:Vector.<Person>;
	public var courses:Dictionary;
	public var color:uint;
}

with de JSON or Base64 encoding, you lose the typed objects and the Dictionary and Vector Content returns null after the deserialization:

var p:Person= new Person();
var jsonPerson = JSON.encode(p);
var p2:Person = JSON.decode(jsonPerson);//ERROR: can't convert Object in Person!!!!!

var p3:Person = new Person();
var b64:String= base64Encode(p);
var p4:Person = base64Decode(b64); ////ERROR: can't convert Object in Peron!!!!!

see it running

this tool let you create your data objects, serialize and deserialize without problems.

Please get the code and read the explained source Main.as

thank you..

About

This class helps the AS# developers to serialize complex typed objects and return the object to the original structure.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published