本文介绍了是否可以从命令行发布 FLA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的项目中,我们有大量(数百个)由艺术家在 CS3 中创建的 FLA 文件,我们从中编译 SWF 以在我们的 Flex/AS3 应用程序中使用.

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.

作为简化的构建/部署系统的一部分,能够自动发布所有这些 FLA 并在理想情况下部署 SWF 将非常方便.我找到了一些使用 JSFL 从 CS3 进行批量发布的方法,但很惊讶地发现 CS3 显然没有任何命令行功能?

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?

这是在 Linux 系统上的价值,我没有使用 JSFL 的经验,不知道您是否可以以某种方式从命令行运行脚本?

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?

注意:我应该说首选 Linux"...我不使用 Linux 但我们的服务器/构建 PC 是 Linux...我没有意识到 CS3 不兼容所以我想我们可以在 Windows 上做这部分.

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.

推荐答案

像这样从命令行执行 JSFL 脚本:

Execute your JSFL scripts from the command line just like this:

在 Windows 上:"c:program filesmacromediaflash 8flash.exe" myscript.jsfl

on Windows: "c:program filesmacromediaflash 8flash.exe" myscript.jsfl

在 Mac 上:打开 myscript.jsfl

我相信旧版本的 Flash 在 Wine 上运行没有问题,但对 CS3 不太确定.

I believe older versions of Flash ran on Wine no problem but not as sure about CS3.

要遍历一批本地文件,请尝试如下操作(在 JSFL 中):

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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-22 20:51