Hello
what i'm trying to do is walk an object that is also a complex tree of objects and output the actionscript 3 code it took (or takes) to create instantiate and populate that object and all its children.
so for instance if you saw something like this in your debugger
myObjectToParse (ParseMe@173e239)
----------[0]someBlob (SomeBlob@173e322)|null
----------[1]someChildren (Array@173e239)
--------------------[0]childFoo (ChildFoo@123e239)
------------------------------someProperty (Number@173e239) | 45
------------------------------someOtherProperty (Number@173e239) | 45
--------------------[1]childBar (ChildFoo@123e239)
------------------------------someStringProperty(String@173e239) | "hello world"
The exporter would spit out:
public class MySerialized extends ParseMe
{
public var someBlob:SomeBlob;
public var someChildren:Array;
public function MySerialized()
{
//populateSomeBlob(); //its null so the export doesn't write it out
populateSomeChildren();
}
private function populateSomeChildren()
{
someChildren=new Array(2);
var childFoo:ChildFoo=new ChildFoo();
childFoo.someProperty=45;
childFoo.someOtherProperty=45;
childFoo.someProperty=45;
childFoo.someOtherProperty=45;
var childBar=new ChildBar();
childBar.someStringProperty="hello world";
someChildren[0]=childFoo;
someChildren[1]=childBar;
}
}
Any tips? Ideas? Thanks!
Edit: I think i may end up just trying to serialize to an amf ByteArray...sounds simpler, but i haven't played with and don't know how many levels deep it can go and what types of references it supports.