触发静态文件的保存对话框 - Flash
如何触发 Flash 中静态文件的保存对话框?如果更容易的话,有问题的文件可以是本地的或远程的。在这种情况下,文件是静态图像。
我是 AS(和 SO)的新手,但对于一个最初看起来非常简单的问题的解决方案的多样性和复杂性感到惊讶。
我已经成功使用 JPEGEncoder(以及 ByteArray、BitmapData 等),但它非常慢,而且显然与文件类型无关。
我使用的是 Flash Pro CS5,而不是 Flex 或 AIR。
How do I trigger a save dialog for a static file in Flash? The file in question can be local or remote, if that's easier. In this case the file is a static image.
I'm new to AS (and SO), but am astonished by how varied and convoluted the solutions are for a problem which initially seems very straightforward.
I've had success with JPEGEncoder (along with ByteArray, BitmapData etc.) but it's extremely slow and obviously not file type agnostic.
I'm using Flash Pro CS5 and not Flex or AIR.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我正确理解你的问题,答案是你不能在闪存上触摸计算机上的任何内容。
我已经问过了
从 bitmapData 获取 jpg 的最简单方法是什么
Adam Smith 建议使用更快的基于炼金术的解决方案而不是 JPEGEncoder:
http://www.websector .de/blog/2009/06/21/speed-up-jpeg-encoding-using-alchemy/
If I understood your question correctly the answer is that you cannot touch any stuff on your computer on flash.
I've asked about that
what is the simpliest way to get jpg from bitmapData
Adam Smith adviced to use faster alchemy based solution instead of JPEGEncoder:
http://www.websector.de/blog/2009/06/21/speed-up-jpeg-encoding-using-alchemy/
您可以使用
FileReference
类通过 Flash 保存文件:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html至于编码,由于质量设置,
JPEGEncoder
可能会非常慢。将其设置为 100% 应该会加快速度。PNGEncoder
速度更快,或者使用 Eugeny89 提出的基于炼金术的解决方案You can save a file through Flash using the
FileReference
class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.htmlAs for encoding, the
JPEGEncoder
can be quite slow due to the quality setting. Setting it to 100% should speed it up.PNGEncoder
is quicker though, or use the alchemy based solution proposed by Eugeny89您可以看看以下内容:
http://ask.amoeba。 co.in/save-images-from-flash-actionsctipt-3-filereference-save-jpgencoder/
You may have a look on the following:
http://ask.amoeba.co.in/save-images-from-flash-actionsctipt-3-filereference-save-jpgencoder/