Compile all the FLA file in Directory and its sub Directory
Toady i spent few hour improving our install process and I look for a way to compile all the swf file in Directory and its sub Directory in the working environment
it was quite easy just a few lines of jsfl
/*
* this file will loop recursively throw all the file and folder in the path
* and publish all the fla i thus directory
*/
var devPath ="file:///E:/WORK/Dev/trunk/"
folderRecorsive(devPath);
/*
* loop throw all the folder a
* for each folder call publishFlieInFolder
*/
function folderRecorsive(pathFolder)
{
var folderNames=FLfile.listFolder(pathFolder,"directories")
for(var i=0;folderNames.length;i++)
{
if(folderNames[i] == undefined)
{
break;
}
if(folderNames[i].indexOf("svn") != -1 ||
folderNames[i].indexOf(".metadata") != -1)
{
}
else
{
var newFolderPath = pathFolder+"/"+folderNames[i]
publishFlieInFolder(newFolderPath)
folderRecorsive(newFolderPath )
}
}
}
/*
* select all the FLA in the give folder
* for each one of them call publishFile
*/
function publishFlieInFolder(folderPath)
{
var files = FLfile.listFolder(folderPath+"/*.fla","files")
for(var i=0;files.length;i++)
{
if(files[i] == undefined)
{
break;
}
var flaPath = folderPath+"/"+files[i]
publishFile(flaPath);
}
}
/*
* publish a fla file and close the document
*/
function publishFile(filePath)
{
fl.openDocument(filePath,true);
fl.getDocumentDOM().publish();
fl.closeDocument(fl.documents[0], false);
}
and few line in the ant install file
<property name="test.jsfl" value="E:\WORK\Dev\trunk\Server\FlashPublish.jsfl"/>
<property name="flash" value="C:\Program Files\Adobe\Adobe Flash CS3\flash.exe"/>
<target name="CompileFlash">
<exec executable="${flash}">
<arg line="'${test.jsfl}'" />
</exec>
</target>
About the picture and now like riding a bicycle with no hands
it will do the work for you.
Willow Road Panda [the photographer]