in4ray / firefly-sdk

Firefly - in4ray Gaming SDK
http://firefly.in4ray.com
Other
54 stars 11 forks source link

Save model problem #4

Closed Tibus closed 11 years ago

Tibus commented 11 years ago

Hello,

I've a problem with saving model into ShareObject and load it. I try to save a model like the Template4 : Bundles with Levels.

Here is what i do in my model :

public var worlds : BindableArray = new BindableArray();
//a world contains a BindableArray with Levels

override public function load(data : Object) : void
{
    _muteSounds.setValue(data.muteSounds);
    worlds.setValue(data.worlds);
}

override public function save(data : Object) : void
{
    data.muteSounds = _muteSounds.getValue();
    data.worlds = worlds.getValue();
}

override public function sleep(data : Object) : void
{
    GameGlobals.systemManager.saveModel(this);
}

In the data object I load, everything is correct but I don't find how to transform the data.worlds to a BindableArray of world with BindableArrays of Levels,...

How could I do this?

Thank's

vstyran commented 11 years ago

Please, refer to this post http://www.actionscript.org/forums/showthread.php3?t=170794 it should help you.