PDA

View Full Version : Publish .fla files from an air APP


thedark_master
10-21-2011, 09:12 PM
I want to make an air app which lets the user specify a folder that contains .fla files and publish them. I know how to do this using JSFL but am stuck on how to run the jsfl file from the air app. If this is possible without jsfl and straight from air, that will work too.

Here is the jsfl script that I am using.

// options
var recursive = false;

// call
main();


function main(){
var folderURI = getFolderURIFromUser();
processFolder(folderURI);
}
function getFolderURIFromUser(){

return fl.browseForFolderURL("Select folder to process");
}
function processFolder(folderURI){

if (folderURI){
var files = FLfile.listFolder(folderURI, "files");
var file, dom;
var i = files.length;
while(i--){
file = files[i];
if (file.slice(-4).toLowerCase() == ".fla"){
fl.publishDocument(folderURI +"/"+ file);
}
}

if (recursive){
files = FLfile.listFolder(folderURI, "directories");
i = files.length;
while(i--){
processFolder(folderURI +"/"+ files[i]);
}
}
}
}

thedark_master
10-25-2011, 10:13 AM
Here is a working example I found that runs a JSFL command from the air app:
http://blog.mencio.com/?p=31

thedark_master
10-26-2011, 01:24 AM
I got it solved... It is a lot simpler than I thought, this is all I had to do:


var file:File = File.desktopDirectory;
file = file.resolvePath("flashPublish.jsfl");
file.openWithDefaultApplication();