What I want? Save my Project in a Editor created with Air Application
What is to save? 1 Object -> Type ArrayCollection -> Contains -> Objects from own classes...
What was my first try?
var stream :FileStream = new FileStream();
stream.writeObject(myArrayCollection);
What was the Problem? The objects inside of myArrayCollection got this Structure:
public class MyClass1
{
public var title:String;
public var description:String;
public var kindOf:String = "...";
public var thumbnail:String;
public var children:ArrayCollection
...}
Every public var were saved by the FileStream.... works fine Inside the children arrayCollection are objects from this class:
public class MyClass2 extends XMLDocument implements IExternalizable
{
public const kindOf:String = "Seite";
[Bindable]
public var title:String;
public var contenBox:OwnClass; //extended spark Group
public function get childrens():ArrayCollection
{
var childs: ArrayCollection = new ArrayCollection();
var i:int = 0;
while(i > (contenBox.container as spark.components.Group).numElements)
{
childs.addItem((contenBox.container as spark.components.Group).getElementAt(i));
i--;
}
return childs;
}
public function readExternal(input:IDataInput):void
{
trace("hello i'am reading");
}
public function writeExternal(output:IDataOutput):void
{
trace("hello i'am writing");
output.writeObject(children);
}
Now the Problem... the fileStream contains my MyClass2 objects with the var "title" but there is no children ArrayCollection... the console don't shows the traces :-/