PDA

View Full Version : As + Xml + Jsfl?


metafocal
10-03-2007, 07:29 PM
I have a folder containing hundreds of swf's. I have used a jsfl script previously to export all .fla's in that folder to .swf's. What I need to do now is create an xml file with the .swf's listed so that my gallery can read the xml and load .swf's as needed. How do I create this xml file via a script? Is this the right area?

Thanks!

mooska
10-03-2007, 09:25 PM
var folder = fl.browseForFolderURL( )

var files = FLfile.listFolder( folder );

var xmlString = "<folder>\r\n"

for(var i in files)
{
var fileName = files[i];

if( fileName.substring( fileName.length - 4 ) == ".swf" )
{
xmlString += " <file>\r\n";
xmlString += " "+fileName+"\r\n";
xmlString += " </file>\r\n";
}


}
xmlString += "</folder>";

file = fl.browseForFileURL( "save" );

FLfile.write( file, xmlString );




I would suggest moving to jsfl forum ;)

metafocal
10-04-2007, 12:26 PM
Apologies for the wrong posting area, the script worked seemlessly. Many thanks!

I have seen numerous places on other sites that claim this couldnt be done. This solution (if not already) needs saved in here or in a JSFL library for others :)

You are the man!

mooska
10-04-2007, 03:35 PM
Apologies for the wrong posting area, the script worked seemlessly. Many thanks!

I have seen numerous places on other sites that claim this couldnt be done. This solution (if not already) needs saved in here or in a JSFL library for others :)

You are the man!
Maany great things could be done with jsfl, not only this ;) Sometimes Im bloggin some of them, maybe Ill collect them some day.

People just rarely know jsfl even exists :]



mooska