保存应用程序状态AIR [英] Saving application state AIR

查看:130
本文介绍了保存应用程序状态AIR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法来保存应用程序状态保存在AIR文件在桌面上(的Flex / AS3)?

Is there a way to save an application state for save files in AIR for the desktop (Flex /AS3)?

感谢

推荐答案

您需要确保所有的类都的序列化,然后序列化并将其退出应用程序时,保存到一个文件中。

You need to make sure all your classes are serializable, then serialize them and save them to a file when exiting the application.

在重新启动应用程序,你反序列化对象 - 实际上实例化的所有对象,然后重新分配他们所有的previous性质

On starting the application again, you deserialize the objects - in effect instantiating all objects and assigning all their previous properties again.

这可以是相当难复古适合现有的应用程序,因为您的code必须遵守一些规则。例如,你的类的构造函数不能接受任何参数和你的对象必须具有公共属性,否则将不被序列化。

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.

这篇文章应该让你加快速度在AS3对象serializaion: http://jacksondunstan.com/articles/ 1642

This article should get you up to speed on object serializaion in as3: http://jacksondunstan.com/articles/1642

这篇关于保存应用程序状态AIR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆