Flash AS3 - 我可以阻止我的共享对象在 .swf 关闭时保存吗?
我有一个具有保存功能的程序 - 用户单击一个按钮,所有内容都会通过flush()保存到本地共享对象中; 命令。
我的问题是,当影片关闭时,Flash .swf 文件会自动保存到本地共享对象,从而覆盖之前的手动保存。
是否有办法在电影关闭时阻止 Flash 保存到共享对象?
I have a program with a save feature - the user clicks a button, and everything is saved to a local Shared Object with the flush(); command.
My problem is that Flash .swf files automatically save to the local Shared Object when the movie is closed, overwriting their previous, manual save.
Is there anyway to prevent flash from saving to the shared object as the movie closes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是可以解决您的问题但不能回答您的问题的东西。 获取共享对象的属性并复制它们。 如果您有“foo”、“bar”和“baz”,则创建“saveFoo”、“saveBar”和“saveBaz”。
当电影开始时,将“保存”版本复制到运行时变体中。 “foo=saveFoo;bar=saveBar;” 等等。
要保存,请将运行时版本复制到“保存”变体中并刷新。
现在,最后的自动保存不会改变任何内容,因为“保存”变体是唯一真正重要的变体。
调味。
Here's something that could solve your problem but not answer your question. Take the properties of your shared object and duplicate them. If you have "foo", "bar" and "baz" then create "saveFoo", "saveBar" and "saveBaz".
When the movie starts, copy the "save" versions into the run-time variants. "foo = saveFoo; bar = saveBar;" and so on.
To save, copy the run-time versions into the "save" variants and flush.
Now the auto-save at the end won't change anything as the "save" variants are the only ones that really matter.
Season to taste.
不,你不能阻止闪存保存共享对象...
另外,我认为,你不应该使用共享对象来维护应用程序状态,除非你想使用确切的效果...
当你读取该对象时,复制它,并在保存时,将副本写入原始...
greetz
back2dos
no, you cannot prevent flash from saving shared objects ...
also, i think, you should not use shared objects to maintain your applications state, unless you want to use that exact effect ...
when you read that object, copy it, and on save, write the copy into the original ...
greetz
back2dos