Jump to content
  • Announcement

    The HyperSpin 2 beta is here!

    We’re starting the first public testing phase with Platinum Members to keep the scope manageable while we test the current feature set and begin to add more. In the future, we’ll provide a version for basic members as well.  On behalf of the entire HyperSpin team, we look forward to another exciting adventure with our community.

Any Flash Coders here? JLFS Script to be precise?


NewYears1978

Recommended Posts

Posted

Been trying to sort this out but can't find an answer. Since HS is coded in Flash/Autoit I figured I would post here and maybe someone would know

 

I use this script

Code:
/** PNG2SWF_MULTIPLE JSFL v 1.0* by Matus Laco,* Modified by dark13 to embedd PNGs as uncompressed files and allow smoothing* product URL:* inspired by Mr.doob** Description:* Converts multiple png files to multiple swf files.* Input: Select folder dialog box* Output: Same folder, same filename, swf extension*/png2swf();function png2swf(){    var folderURI = fl.browseForFolderURL("Select a folder.");    if (folderURI == null) { return; }    var folderContents = FLfile.listFolder(folderURI);var doc = fl.createDocument();doc.backgroundColor = '#00FF00';var imported = 0;    for(var i=0; i< folderContents.length; i++){                        var pngURI = folderURI + "/" +folderContents[i];    if (pngURI.substr(pngURI.length-4) != ".png") continue;        doc.importFile(pngURI);        // get item            var bmp_lib = doc.library.items[imported];    bmp_lib.compressionType = "lossless";        bmp_lib.allowSmoothing = true;    var bmp_tl = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];// Scale from 1080p to 1024*768 and apply 16:9 ratio correctionbmp_tl.scaleX = 0.53333 ;bmp_tl.scaleY = 0.7111 ;bmp_tl.x = 0 ;     bmp_tl.y = 0 ;// set doc size        doc.width = Math.floor(bmp_tl.width)+1;        doc.height = Math.floor(bmp_tl.height)+1;    // export            var swfURI = pngURI.substr(0,pngURI.lastIndexOf(".")+1)+"swf";        doc.exportSWF(swfURI, true );        // remove previous from timeline        doc.selectAll();        doc.deleteSelection();        // increase imported count        imported++;    }    doc.close(false);    alert(imported + " files created.");}

Works great except I would like it to also look in the subfolders of my selected folder.

Thanks in advance! I've been googling for 2 days, but no luck.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...