Florian Metzger - Neodelight wrote:
i want to serialize the shared object and dump it into a text file and later
deserialze the shared object from that text file.
does anybody have a script or class for that ?

Actually, MM provides a fairly decent serializer:

  mx.data.binding.ObjectDumper;

Here's a simple use case in Actionscript 2.0:

  import mx.data.binding.ObjectDumper;

  myObj = {a:3.14, b:'test string', c:false};
  myObj.d = [1, 2, 3, 4];
  myObj.e = [];
  myObj.e['test'] = new Date();

  trace(ObjectDumper.toString(myObj));

The output is very similar to Crockford's JSON [1], it shouldn't be very difficult to write a deserializer to parse the result and convert it back into objects.

Alternatively, you can go with an XML format typed through a DTD, which, depending on your use cases and server-side integration needs, might be more desirable than using the JSON format.

Jim
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to