保存应用程序状态AIR

编程入门 行业动态 更新时间:2024-10-25 06:26:53
本文介绍了保存应用程序状态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: jacksondunstan/articles/ 1642

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

更多推荐

保存应用程序状态AIR

本文发布于:2023-11-23 14:15:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621736.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   状态   AIR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!