when we start working on Mogobe I worte a small JSFL script. that script loop throw all of my project folder look for FLA
files and publish them one after a other.
Add that script to the buld task in my Ant file. that was fin for the begining but now that the project is so big and any thing can go wong
and staff did go wong and same time the one of the fla file did not publish as expected . The probleam was that you we did nt know about it
the JSFL script just move to the next file.
So I need to add an Error handling for the script and to be shore that I will be compile them correctliy I fond that on the web
http://summitprojectsflashblog.wordpress.com/2009/03/10/jsfl-for-mass-publish-with-error-reporting/
but that was only handling complie error if some thing else go wong like the publish to folder dose not exsist it will move on without publishing
here is what I added this is the new function that in JSFL that publish FLA with complete Error handling .
(How to loop throw all the folder subfolder and find FLA file you can find here )
/*
* pubilsh a fla file and colse the document
*/
function publishFile(filePath)
{
try
{
fl.openDocument(filePath);
fl.getDocumentDOM().publish();
// handling error of out folder dose not exsist
fl.outputPanel.save(filePath + ".out") // save the out put to file
var output = FLfile.read(filePath + ".out"); // read the out put from the file
FLfile.remove(filePath + ".out");// delete the out put file
// handling error of flash compile
fl.compilerErrors.save(filePath + ".error"); // save the out put to file
var contents = FLfile.read(filePath + ".error"); // read the out put from the file
FLfile.remove(filePath + ".error"); // delete the out put file
// checking if file can be created path existing problem
if(output.indexOf("Error creating Flash movie file") != -1 )
{
hasError = true;
}
else if(contents != "") // checking for flash compile errors
{
hasError = true;
}
else
{
fl.closeDocument(fl.documents[0], false);
}
}
catch(e){
hasError = true;
}
}
the probleam was that when the folder dose not exsist the fl.compilerErrors is empty becase the complie is not started
so i need to add another chek in the out put panle
the next question that I wold ask way writing the fl.outputPanel fl.compilerErrors object to the file system I realy did not find any other way to get the data from
thouse object
