今天浏览了下jsfl的文档,写下这个,权当是个小练习,有改进的方法大家就提。
在较大的flash项目中,一个目录中存在成百上千的fla文件。为了统一,还会使用共享库。我们就需要一个方便的工具来批量发布。其实这样的工具已经有不少了(http://www.luar.com.hk/flashbook/archives/000841.php)。
但今天使用jsfl做了个轻量级的(1K ^_^)。环境:flash 7.2(使用了File API)
先打开任意一个需要发布目录中的fla文件,然后执行本文件,就可以去喝茶了。
发布时不想保存源文件就把最后一句改成flash_document.close(false)
国庆很忙,不更新了。
在较大的flash项目中,一个目录中存在成百上千的fla文件。为了统一,还会使用共享库。我们就需要一个方便的工具来批量发布。其实这样的工具已经有不少了(http://www.luar.com.hk/flashbook/archives/000841.php)。
但今天使用jsfl做了个轻量级的(1K ^_^)。环境:flash 7.2(使用了File API)
先打开任意一个需要发布目录中的fla文件,然后执行本文件,就可以去喝茶了。
发布时不想保存源文件就把最后一句改成flash_document.close(false)
国庆很忙,不更新了。
/** Flash JSAPI Source File -- Created with SAPIEN Technologies PrimalScript 3.1 @author magicwind @file publish.jsfl */ var folderPath = fl.getDocumentDOM().path; folderPath=folderPath.split("\\"); folderPath.pop(); folderPath = "file:///"+folderPath.join("/")+"/"; fl.trace(folderPath); //var folder = FLfile.listFolder("file:///D|/kevin/temp/"+"*.fla","files"); var folder = FLfile.listFolder(folderPath+"*.fla","files"); for (var file in folder){ var flash_document = fl.openDocument(folderPath+folder[file]); flash_document.publish(); //flash_document.deletePublishProfile(); //fl.saveDocument(); flash_document.close(true); }
回复Comments
作者:
{commentrecontent}