简体   繁体   English

如何保存.swf文件的状态?

[英]How to save state of a .swf file?

I have some swf files (games) which I play using Swiff player... 我有一些使用Swiff播放器播放的swf文件(游戏)...

Is there any way to save the state of the swf file ?? 有什么方法可以保存swf文件的状态? so that I don't have to start the game all over from level 1 again !! 这样我就不必再次从1级开始游戏了!!

It is posible to save the state of a process and load it later. 可以保存进程的状态并在以后加载它。 There is an appliction, SmartClose (freeware) that save snapshot of the system and kill applications process to temporarily gain resources: Look at it! 有一个应用程序SmartClose(免费),它可以保存系统快照并杀死应用程序进程以暂时获取资源:快看吧!

It is posible so, to use it to close (kill) flashplayer or web browser, and restore the snapshot later. 因此可以使用它来关闭(杀死)Flash Player或Web浏览器,并在以后还原快照。 The application is intended to close all programs, but it can be customized to close just the flashplayer. 该应用程序旨在关闭所有程序,但可以对其进行自定义以仅关闭Flash Player。 It might (should) exist a simple command line app to do it, and it is not necesary to kill the process, just save the snapshot (C:\\save flashplayer.exe snap1.sav for example). 它可能(应该)存在一个简单的命令行应用程序来执行此操作,并且不必杀死该进程,只需保存快照即可(例如,C:\\ save flashplayer.exe snap1.sav)。 I don't know how to program such thing, but it is posible!! 我不知道该如何编程,但是有可能!

Is there any way to save the state of the swf file ?? 有什么方法可以保存swf文件的状态?

Yes, there is actually a very simple solution the requires no programming skills or entering manual commands: 是的,实际上有一个非常简单的解决方案,不需要编程技能或输入手动命令:

Run the game on a virtual machine and save the state. 在虚拟机上运行游戏并保存状态。 I've had the same problem and then had the idea to use VirtualBox' "Snapshot" function. 我遇到了同样的问题,然后想到了使用VirtualBox的“快照”功能。

Get the software at virtualbox.org 在virtualbox.org上获取软件

From a programming standpoint the only way that you can save the state of a flash game is if the developer wrote code to allow state to be saved. 从编程的角度来看,保存Flash游戏状态的唯一方法是开发人员编写了允许保存状态的代码。

If I understand you right, it sounds like you are looking to duplicate the behavior you might find in, for instance, a super nintendo emulator - but that level of control there, that allows you to save state in any given ROM, is operating at the runtime level. 如果我没听错,听起来像是您要复制的行为可能会在超级任天堂仿真器中找到,但是该控制级别允许您将状态保存到任何给定的ROM中,运行时级别。

Unless you write your own Flash Player that gives you the ability to save state in a similar way you're not going to find the same functionality. 除非您编写自己的Flash Player,它使您能够以类似方式保存状态,否则您将找不到相同的功能。

I hope that makes sense, let me know if you have any other questions. 我希望这是有道理的,如果您还有其他问题,请告诉我。

If you are using Swiff, which means you publish your flash app as a html-css-javascript file, then you can create a database and save it there with the help of php or asp.net. 如果您使用的是Swiff,这意味着您将Flash应用程序发布为html-css-javascript文件,则可以创建数据库并将其保存在php或asp.net的帮助下。 But when you want to publish it by swf file, you can reference here for further info ( Saving state in AIR applications for iOS devices ). 但是,当您要通过swf文件发布它时,可以在这里参考以获取更多信息( 在iOS设备的AIR应用程序中保存状态 )。

I'm not familiar with Swiff player. 我不熟悉Swiff播放器。 Is the game being played in the browser? 游戏正在浏览器中玩吗? If so, you can save state in a cookie on the user's local computer. 如果是这样,您可以将状态保存在用户本地计算机上的cookie中。 Otherwise, there's really no way to persist state locally. 否则,实际上没有办法在本地保持状态。 The only other option would be to use a server-based solution and save state in a database. 唯一的其他选择是使用基于服务器的解决方案并将状态保存在数据库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM