Hi,
i've a little proble with shared object...can you help me?
i've a value object:
public class WindowInfo
{
private var _id:String;
private var _module:String
public function WindowInfo(id:String, module:String)
{
this._id = id;
this._module = module;
}
public function get id():String {
return _id;
}
public function get module():String {
return _module;
}
}
}
then i have a function that created for each window in the main app a
new windowinfo instance and save it into an array collection.
public function savedWidowsConfiguration():ArrayCollection {
var ac:ArrayCollection = new ArrayCollection();
var keys:Array = modules.getKeys();
for(var i:uint = 0; i < keys.length; i++){
var w:CustomWindow = hashMap.getValue(keys[i]);
var wi:WindowInfo = new WindowInfo(keys[i],
w.module);
ac.addItem(wi);
}
return ac;
}
the array is passed to the shared object manager with add function:
public class SharedObjectManager {
private var mySO:SharedObject;
public function SharedObjectManager(s:String) {
init(s);
}
private function init(type:String):void {
mySO = SharedObject.getLocal(type);
if (getModules()) {
getModules();
}
}
public function getModules():ArrayCollection {
return mySO.data.windowinfo;
}
public function add(array:ArrayCollection):void {
mySO.data.windowinfo = new ArrayCollection();
mySO.data.windowinfo = array;
mySO.flush();
}
}
finally i retrieve the results at creation complete event from the
main applcation:
public function init():void {
sharedObjectManager = new SharedObjectManager("MODULES");
if (sharedObjectManager.getModules()) {
mdiCanvas.reloadExistingModules(sharedObjectManager.getModules());
}
}
but when i retrieve the results windowinfo array is an arraycollection
where windowinfo objects are empty...it's very srange because
"mySO.data.windowinfo = array" has data...
why?
thanks in advance
regards Lorenzo