是否可以从命令行发布 FLA?
在我们的项目中,我们有大量(数百个)由艺术家在 CS3 中创建的 FLA 文件,我们从中编译 SWF 以在 Flex/AS3 应用程序中使用。
作为简化的构建/部署系统的一部分,如果能够自动发布所有这些 FLA,并且理想情况下还可以部署 SWF,那将非常方便。 我找到了一些使用 JSFL 从 CS3 进行批量发布的方法,但惊讶地发现 CS3 显然没有任何命令行功能?
这是在 Linux 系统上的价值,我没有使用 JSFL 的经验,不知道是否可以以某种方式从命令行运行脚本?
注意:我应该说“Linux 是首选”...我不使用 Linux,但我们的服务器/构建 PC 是 Linux...我没有意识到 CS3 不兼容,所以我猜我们可以在 Windows 上完成这部分。
In our project we have a large number (hundreds) of FLA files created by the artists in CS3, from which we compile SWFs to use in our Flex/AS3 application.
As part of a streamlined build/deploy system, it would be really handy to be able to automate publishing all these FLAs, and ideally deploying the SWFs too. I found some ways to do the batch publishing from CS3 using JSFL, but was surprised to discover CS3 doesn't apparently have any command-line functionality for this?
This is on a Linux system for what it's worth, I don't have experience with JSFL to know if you can run scripts from the command line somehow?
note: I should have said "Linux is preferred"... I don't use Linux but our server/build PC is Linux... I didn't realise CS3 was not compatible so I guess we can do this part on Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
从命令行执行 JSFL 脚本,如下所示:
在 Windows 上:
"c:\program files\macromedia\flash 8\flash.exe" myscript.jsfl
在 Mac 上:
打开 myscript.js 文件。 jsfl
我相信旧版本的 Flash 在 Wine 上运行没有问题,但在 CS3 上则不太确定。
要迭代一批本地文件,请尝试这样的操作(在 JSFL 中):
您可能想要研究的其他一些方法是..
fl.getDocumentDOM()
document.exportSWF()
document.publish()
fl.closeDocument()
Execute your JSFL scripts from the command line just like this:
on Windows:
"c:\program files\macromedia\flash 8\flash.exe" myscript.jsfl
on Mac:
open myscript.jsfl
I believe older versions of Flash ran on Wine no problem but not as sure about CS3.
To iterate over a batch of local files, try something like this (in JSFL):
And some other methods you'll probably want to investigate are..
fl.getDocumentDOM()
document.exportSWF()
document.publish()
fl.closeDocument()
您如何在 Linux 上运行 Flash CS3?
您无法从命令行运行 JSFL,但编译 FLA 文件应该是可能的
一些旧示例
http://www.mikechambers .com/blog/2003/11/01/flashcommand-flash-2004-command-line-compiler/
来自 Mike Chambers 的新内容
http://code.google.com/p/flashcommand/ 对于 OSX
所以这绝对是似乎只能通过半自动化的 IDE 发布来实现,
可惜 Flex 编译器无法做到这一点,再加上 ANT 任务,它就是一个杀手……
使用 FDT 编辑器,事情变得非常酷并且自动化
How you are running Flash CS3 on Linux ?
you cannot run JSFL from command line but compiling a FLA file should be possible
some old example
http://www.mikechambers.com/blog/2003/11/01/flashcommand-flash-2004-command-line-compiler/
newer stuff from Mike Chambers
http://code.google.com/p/flashcommand/ for OSX
so it's definitely possible seems only through semi automated IDE publishing,
too bad Flex compiler is not capable of such a thing, together with ANT tasks it's a killer...
with FDT editor things are pretty cool and automated
就像已经说过的那样,可以使用 JSFL 脚本来完成,尽管您仍然需要有与 Adobe Flash Professional 通信的命令行工具,以将进程记录到 stdout 并根据编译结果提供退出代码。
我最终自己编写了这个工具 https://www.npmjs.com/package/flc。 它基本上是一个命令行界面,抽象了 Adobe Flash Professional。 针对 Flash Pro 2014 和 2015 进行了测试。
Like it was already stated, it is possible to do with JSFL scripts, although you still need to have command line tool that communicates with Adobe Flash Professional to log the process into stdout and supply exit code based on compilation result.
I ended up writing this tool myself https://www.npmjs.com/package/flc. It is basically a command line interface that abstracts Adobe Flash Professional away. Tested against Flash Pro 2014 and 2015.
是的,一点没错。 事实上,我已经构建了一个端到端解决方案,只需单击一个按钮,即可使用版本时间戳更新类文件,打开 Flash(如果尚未打开),打开单个文件进行发布,发出信号当每个文件完成发布时,通过进程间通信进行自动化程序,这样您就不会遇到任何计时问题,并在完成后将特定文件部署到网络(在自动备份它们并为文件名加上时间戳之后),以及整个过程10 秒内完成。
请参阅我的问答:自动发布 FLA 文件; 多次调用 Process.Start
Yes, absolutely. In fact, I've built an end-to-end solution which, at the click of a single button, will update class files with a version time stamp, open Flash if it's not already open, open individual files for publication, signal the automation program via inter-process-communication when each file has completed publishing so you don't run into any timing issues, and deploy specific files to the web upon completion (after automatically backing them up and timestamping the filenames), and the whole process completes in under 10 seconds.
See my Q&A here: Automating publishing of FLA files; calling Process.Start multiple times