使用 Adobe AIR 执行自动保存,无需打开弹出保存框
我有一个 AIR 应用程序,我想实现自动保存功能。目前,我有一项服务使用计时器来检查应用程序中当前活动文件的状态,然后如果该文件更改为新文件,该服务会检查当前文件名(如果已更改),则该文件已更改。 发生这种情况时,我想执行自动保存,我可以这样做,但问题是调用保存时会打开保存弹出保存框,这就是我调用保存函数的方式:
var file:File = File.userDirectory .resolvePath( 文件路径 ); 文件.save( jsonToExport );
有没有办法在不打开弹出框的情况下调用 save() 函数?
谢谢
斯蒂芬
I've an AIR app that I'd like to implement a auto-save functionality. Currently I have a service that uses a timer to check the status of the current active file in my app, then if the file changes to a new file, the service checks the current file name if that has changed then the file has changed.
When this happens I want to perform a auto-save, which I can do but the problem is that the save popup save box opens when the save is called, this is how I call the save function:
var file:File = File.userDirectory.resolvePath( filepath );
file.save( jsonToExport );
Is there a way to call the save() function without a popup box opening?
Thanks
Stephen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 FileStream 直接写入文件,而不是使用 File 的 save 方法:
Rather than using the File's save method, try using a FileStream to write the file directly: