问题描述
在我们的项目中,我们有大量(数百)由CS3中的艺术家创建的FLA文件,我们从中编译SWF以用于我们的Flex / AS3应用程序。作为一个精简的构建/部署系统的一部分,能够自动发布所有这些FLA,并理想地部署SWF也是非常方便的。我发现了一些使用JSFL从CS3进行批量发布的方法,但是惊讶地发现CS3并没有明显的命令行功能呢?
在Linux系统上,我没有JSFL的经验,知道你是否可以通过命令行运行脚本?
$ b note :我应该说Linux是首选的...我不使用Linux,但我们的服务器/构建PC是Linux ...我不知道CS3不兼容,所以我想我们可以做这个部分在Windows上运行。
执行命令行中的JSFL脚本就像这样:
在Windows上:c:\ program files \macromedia\flash 8\flash.exemyscript.jsfl
在Mac上:打开myscript.jsfl
我相信旧版本的Flash跑在葡萄酒没有问题,但不是肯定的CS3。
要遍历一批(在JSFL中):
var importFolder = fl.browseForFolderURL('Select a folder with existing FLA文件);
var importFolderContents = FLfile.listFolder(importFolder);
for(i = 0; i< importFolderContents.length; i ++){
file = importFolderContents [i];
fl.openDocument(file); //等等
}
以及其他一些您可能需要调查的方法是..
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.
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):
var importFolder = fl.browseForFolderURL('Select a folder with existing FLA files');
var importFolderContents = FLfile.listFolder(importFolder);
for (i = 0; i <importFolderContents.length; i++) {
file = importFolderContents[i];
fl.openDocument(file); // and so on
}
And some other methods you'll probably want to investigate are..
fl.getDocumentDOM()document.exportSWF()document.publish()fl.closeDocument()
这篇关于是否可以从命令行发布FLA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!