I had similar problem and what I've done for saving:
1. Get the root element of all flexdockable components and go through
the whole hierarchy.
2. For every flexdockable component I create a simple as3 object and
save the following component properties "x", "y", "width", "height",
"label", "percentWidth", "percentHeight", "text", "selectedIndex" plus
its class name to it. This new object is then inserted into the
corresponding object of the parent of the component.
3. After this i can persist the root as3 object.
(4. In my case I need only to store the bytes in the local user
storage aka flash cookie, but you can store them in a DB)
On starting I load the as3 object and create the same hierarchy and
properties and the application is restored.
But In your case by restoring the user objects you can create
tabnavigator instead of dockabletabnavigator and hbox instead of
dockablehdividedbox. So the user will not have the possibility to
change anything.
Here the example code for saving:
static private const persistentFields:Array = ["x", "y", "width",
"height", "label",
"percentWidth", "percentHeight", "text", "selectedIndex"];
static private function
saveObject(obj:UIComponent):Object {
var o:* = {};
o.className = getQualifiedClassName(obj);
for each (var s:String in persistentFields)
if (obj.hasOwnProperty(s))
o[s] = obj[s];
o.children = [];
if (obj is Container && !isDockableComponent(obj))
for each (var childObj:DisplayObject in (obj as
Container).getChildren())
if (childObj is UIComponent)
o.children.push(saveObject(childObj as UIComponent));
return o;
}
You must also implement isDockableComponent as I use also a custom
function.
The code for loading is very customized for my case.
hope this can help.
Toshe