如何将图片文件夹添加到 Flash 应用程序?
我有一个显示图片的 Flash 应用程序(部署为 Air 或 iOS 的常规应用程序)。
它必须离线工作,所以我需要将我的照片与 Flash 应用程序捆绑在一起。我编写了一个脚本,在部署 Flash 应用程序之前将所有图片从服务器下载到特定文件夹。目前,我从 FLA 中删除所有现有图片并添加新图片,但我想知道是否有一种方法可以为 Flash 定义系统文件夹,并且它将在部署过程中获取其中存在的任何内容?
所以基本上我要做的就是运行我的脚本(用新图片更新文件夹)并重新编译 FLA。
I have a flash app (deployed as Air or regular app for iOS) which displays pictures.
It has to work offline, so I need to bundle my pictures with the flash app. I wrote a script to download all pics from my server to a specific folder before deploying the flash app. Currently, I remove all existing pictures from the FLA and add the new ones, but I was wondering whether there is a way to define a system folder for flash and it will take whatever exists there during the deployment process?
So basically all I'll have to do will be to run my script (to update the folder with the new pics) and recompile the FLA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,我不知道闪存是否提供任何功能来直接满足您的要求。我也没有注意到 AIR,因为没有相同的标签。无论如何,这是我的 2 美分。
as3 文件)来嵌入您的资源。
嵌入是通过以下方式完成的,
因此每次您的脚本将图像添加到文件夹中时,它都可以将图像的嵌入行添加到 Document 类 AS3 文件中。然后,您可以像往常一样访问 Flash 中的资源,
编辑:
嵌入的每个图像都应该有一个与之关联的类。否则,嵌入后您将如何访问图像。所以无论你做什么,每张图像都需要一个类。不用担心 2000 个变量会导致内存膨胀什么的。它们将在运行时由闪存很好地管理。
此外,AS3 在运行时无法访问文件系统,因此此时可能没有解决方案。
来看看那些有类似疑问的人&得到类似的回复
http://flashpunk.net/forums/index.php?topic=2323.0
Actionscript 嵌入数组
这里有一些其他元数据标签
http://www.boostworthy.com/blog/ ?p=157
Well I don't know if flash offers any feature to ease your requirement directly. Also I didn't notice AIR, as there is no tag for the same. Anyways here is my 2 cents.
as3 file) to embed your resources.
Embedding is done by
So every time your script adds an image into the folder, it can add the embed lines for the image into the Document class AS3 file. You may then access the resource in flash as usual,
EDIT:
Every Image that is embedded should have a class associated with it. Or else, how else will you access the image after embedding. So whatever you do, every image needs a class. Dont worry about 2000 variables bloating memory or something. They will be managed just fine by flash during runtime.
Also AS3 does not have access the to the file system at runtime so there could be no solution at that point.
Here have a look at those people who had similar doubts & got similar responses
http://flashpunk.net/forums/index.php?topic=2323.0
Actionscript embed an array
And here is a little of other metadata tags
http://www.boostworthy.com/blog/?p=157