将文件引用存储在共享对象中

发布于 2024-09-07 22:24:37 字数 215 浏览 8 评论 0原文

我想以某种方式存储 FileReference 对象,并在 SWF 再次加载时加载它。

我尝试使用 SharedObject 类,但它似乎不起作用。我怀疑由于安全问题(不使用 Adob​​e AIR),我想做的事情是不可行的,但我想检查一下。

有谁知道是否有办法存储 FileReference 对象并在 SWF 重新启动时加载它?

非常感谢你,

鲁迪

I would like to store a FileReference object somehow and load it when the SWF loads again.

I tried to use the SharedObject class but it does not seem to work. I suspect that what I want to do is not doable due to security issues (not using Adobe AIR), but I wanted to check.

Does anyone please know if there is anyway to store a FileReference object please and load it when the SWF is restarted?

Thank you very much,

Rudy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你的星星会说话 2024-09-14 22:24:37

我认为您不能将 FileReference 存储到 SharedObject 中。或者至少,我认为您无法取回文件数据,因此实际上没有太大区别。

但是,从 Flash Player 10 开始,有一个 load 方法可让您读取文件(通过 data 属性)。

数据作为 ByteArray 进行访问,可以将其序列化并存储到 SO 中以供以后检索。因此,您可以要求用户选择一个文件,读取其二进制数据并将其存储在 SO 中(默认情况下有 100 Kb 限制,因此您很可能必须要求用户提供一些额外的空间)。

下次加载您的应用程序时,您应该能够从 SO 中获取文件数据(前提是数据已成功保存且 SO 尚未被删除)。

I don't think you can store a FileReference into a SharedObject. Or at least, I don't think you could get the file data back, so in practice there's not much difference.

However, as of Flash Player 10, there's a load method in the FileReference object that lets you read the file (through the data property).

The data is accessed as a ByteArray, which can be serialized and stored into a SO for later retrieval. So you could ask the user to select a file, read its binary data and store it in a SO (there's a 100 Kb limit by default, so you would most likely have to ask the user for some extra space).

Next time your app is loaded, you should be able to get the file data from the SO (provided that the data was successfully saved and the SO has not been deleted).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文