Is there a way to save an application state for save files in AIR for the desktop (Flex /AS3)?
Thanks
Is there a way to save an application state for save files in AIR for the desktop (Flex /AS3)?
Thanks
You need to make sure all your classes are serializable, then serialize them and save them to a file when exiting the application.
On starting the application again, you deserialize the objects - in effect instantiating all objects and assigning all their previous properties again.
This can be rather hard to retro-fit to an existing application since your code must adhere to a few rules. For instance, your class constructors cannot accept any arguments and your objects must have public properties or they will not be serialized.
This article should get you up to speed on object serializaion in as3: http://jacksondunstan.com/articles/1642