如何为Flash项目设置常规发布设置?

如何为Flash项目设置常规发布设置?,flash,flash-cs5.5,Flash,Flash Cs5.5,在Flash 5.5中,您可以创建Flash项目,允许您在生产时共享Flash文件库。它还允许您一起发布所有文件 我想在发布所有flash fla文档时,将输出的swf文件保存到特定文件夹中。 我找不到一种方法使其自动,因此如果您有200个文件,您需要转到每个fla文档并更改其发布设置。这破坏了所有项目的效用 也许可以使用jsfl来实现。然而,我更喜欢用其他方式,这样我们的艺术家团队就可以像以前一样继续工作 非常感谢您的时间和帮助。您的问题的答案是肯定的,JSFL可以为您做到这一点。我将给出一个

在Flash 5.5中,您可以创建Flash项目,允许您在生产时共享Flash文件库。它还允许您一起发布所有文件

我想在发布所有flash fla文档时,将输出的swf文件保存到特定文件夹中。 我找不到一种方法使其自动,因此如果您有200个文件,您需要转到每个fla文档并更改其发布设置。这破坏了所有项目的效用

也许可以使用jsfl来实现。然而,我更喜欢用其他方式,这样我们的艺术家团队就可以像以前一样继续工作


非常感谢您的时间和帮助。

您的问题的答案是肯定的,JSFL可以为您做到这一点。我将给出一个示例,并尽可能地在jsfl代码中注释,以解释发生了什么。请随时提出任何澄清问题

因此,假设您的计算机上有一个文件夹,其中包含许多其他文件夹,这些文件夹都保存着FLA文件。这段代码将遍历主包含文件夹中的所有文件夹,我们称之为“allFLAs”,然后将它们输出到名为“allSWFs”的文件夹中。下面的代码将allFLAs中的原始文件夹保存在allSWFs中。因此,如果FLA文件位于allFLAs/group1/file1.FLA,那么在allSWFs中会有allSWFs/group1/file1.swf。如果您的文件具有相同的名称,则不会相互覆盖。您只需从exportSWF行中删除+dirList[n],它就会将所有swf放入主allSWFs文件夹中

此代码不会更改其运行的任何文件的发布设置,并且在完成后关闭Flash IDE

// Main folder that holds the folders containing all the FLA files.
var folder = 'file:///C:/path/to/main/folder/allFLAs';

if (!null) {
    // Create an array of all the folders that are contained in our main folder.
    var dirList = FLfile.listFolder(folder, 'directories');
    // Loop through each item in the array to find each FLA file.
    for (var n = 0; n<dirList.length; ++n) {
        // Create an array of all FLA files in the directory list array.
        var list = FLfile.listFolder(folder+'/'+ dirList[n] + '/*.fla', 'files');
        fl.outputPanel.trace('file:///C:/path/to/output/folder/allSWFs/'+ dirList[n]);
        // Create containing folder for this file based on the name of the folder in the directory list array, in the new output folder.
        FLfile.createFolder('file:///C:/path/to/output/folder/allSWFs/'+ dirList[n]);
        var flaName;
        var swfName;
        for (var i = 0; i<list.length; ++i) {
            flaName = list[i];
            swfName = list[i].split('.')[0]+'.swf';
            fl.outputPanel.trace(flaName+' exported as '+swfName);
            // open the document, publish to SWF, and close without saving.
            fl.openDocument(folder+'/'+ dirList[n] +'/'+flaName);
            fl.getDocumentDOM().exportSWF('file:///C:/path/to/output/folder/allSWFs/'+ dirList[n] + '/'+swfName, true);
            fl.closeDocument(fl.getDocumentDOM(), false);
        }
    }
}
fl.quit()
//保存包含所有FLA文件的文件夹的主文件夹。
var文件夹file:///C:/path/to/main/folder/allFLAs';
如果(!null){
//创建主文件夹中包含的所有文件夹的数组。
var dirList=FLfile.listFolder(文件夹“目录”);
//循环遍历数组中的每个项以查找每个FLA文件。
对于(var n=0;n