使用具有大型库的 fla 中的类生成单独的 SWF
我有一系列大型 fla 文件,它们被发布到 SWC 中,然后直接在 Flash 项目中使用。大概总共有1000多个物体。随着数量的增长,最终编译的 swf 变得相当大,因此我只想根据需要下载每个对象的单独 swf。然后,我需要能够通过最终 AS 项目中的类名访问和克隆该对象。
问题是我发现导出每个文件的唯一方法是 1) 将其复制并粘贴到新的 fla 文件中 2) 双击“编辑”它以强制包含它,3) 重置链接(类)名称,因为它已被擦除,4) 发布(即文件->发布)并命名此 swf。
对于其中 1000 多个,这将需要相当长的时间。
虽然您可以右键单击库中的每个项目将其另存为 swf,但它似乎不包含类名等,仅包含项目。一旦我下载了这个,我就无法克隆以多次使用它而不再次下载它,这是不可接受的。
有没有更快/更好的方法来生成这些 swf?
(我确实简单地研究过 xfl,但考虑到一些未知因素,看起来需要编写一个脚本来执行此操作,这比手动执行需要更长的时间。)
I have a series of large fla files that were being published into swc's and then used directly in an flash project. Probably a total of 1000+ objects. As the number grows the final compiled swf is getting quite large so I want to download individual swf's of each object only as needed. I then need to be able to access and clone the object via classname from the final AS project.
The issue is the only way I have found to export each one is to 1) copy and paste it into a new fla file 2) double click to 'edit' it to force it included, 3) reset the linkage (class) name since it was wiped, 4) publish (i.e. file->publish) and name this swf.
This will take quite a while for 1000+ of these.
While you can right-click on each item in the library to save it as a swf, it appears NOT to include the classname etc, just the item. Once I download this, I cannot clone to use it more then once without downloading it again which is unacceptable.
Is there a faster/better way to generate these swf's?
(I did look into xfl briefly but it looks like writing a script to do this given some of the unknowns there will take longer then just doing it by hand.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该查看 JSFL,它允许您扩展 Flash/编写一个脚本来自动为您执行此任务。
例如,您可以编写一个脚本,循环遍历库中的元素,并仅针对为 ActionScript 导出的影片剪辑导出 swf,并生成一些 LoaderMax 代码:
将其另存为 .jsfl 文件以运行它,将其放置在 Flash(IDE) 的命令 文件夹,它将弹出在界面的命令菜单中。
这并不完美,但它给出了可以做什么的想法。首先是建立我想象的工作流程,然后为其编写脚本。
有几件事我不明白,我试图分解它:
因此,有些 fla 的资产需要稍后进行编码。
我想象一个 SWC 将包含多个为 ActionScript 导出的 MovieClip
并且可能有更多具有不同类型资产的 fla 文件。
您的意思是使用 getDefinition 实例化 swf 文件中的类吗?
对于步骤1,您不能右键单击MovieClip并选择ExportSWF/ExportSWC(取决于您的需要)吗?
我不明白你所说的“强制包含”是什么意思。
您的意思是勾选 Export for Actionscript 吗?谁/什么擦除了链接?
You should have a look at JSFL which allows you to extend Flash/write a script that will automate this task for you.
You could for example write a script that loops through elements in the library and exports swf only for movieclips that are exported for actionscript, and generates a bit of LoaderMax code which is placed in the clipboard when the export is complete:
Save this as a .jsfl file to run it, place it in Flash(IDE)'s Commands folder and it will pop in Commands menu in the interface.
This not perfect, but it gives an idea of what can be done.The first thing is to establish a workflow I imagine, then to write the scripts for it.
There a few things I didn't understand though, I'm trying to break it down:
So there are some fla with assets that need to be coded later on.
I imagine a swc will contain multiple MovieClips exported for actionscript
and there are probably more fla files with different types of assets.
Do you mean instantiate classes from swf files, using getDefinition ?
For step 1, can you not right click the MovieClip and choose ExportSWF/ExportSWC(depending on what you need) ?
I don't understand what you mean by 'force it included'.
Do you mean tick Export for Actionscript ? Who/What wipes the linkage ?