This is a JSFL script that I created to generate thumbnail icons at various sizes from a piece of artwork in Flash.

// Multiple Size PNG Exporter
// Copyright © 2018 Andrew Doll
// http://www.andrewdollcreative.com/

/* NOTE:Before running this script export one PNG image using the desired PNG export settings.  fl.getDocumentDOM.exportPNG() accepts 3 
** paramaters. The first is the string for the file name.  The second is a Boolean value that specifies whether to use the current PNG 
** publish settings (true) or to display the Export PNG dialog box (false).  The third is a Boolean value that specifies whether to export 
** only the current frame (true) or to export all frames, with each frame as a separate PNG file (false).  Since this script sets the
** second paramater to true just be sure that the PNG export settings are already set to 32 bit PNG.
*/

var dom = fl.getDocumentDOM();
if (dom == null)
{
    alert("Please open a file.");
}
else
{
    var sel = [];
    var exportSizeArray = [];
    var folderURI = "";
    var folderLocation = "";
    var pngFileName = "";
    var URI = "";
    var selWidth;
    var selHeight;
    var sideToUse;
    var scaleAmount;

    function setupExportFolder()
    {
        folderLocation = fl.browseForFolderURL("Select a folder.");
        if(folderLocation != null)
        {
            folderURI = folderLocation + "/PNG Exports";
            FLfile.createFolder(folderURI);
            pngFileName = prompt("What would you like to name the png files?");
        }
    }

    function calculateScaleAmount(selWidth, selHeight)
    {
        if(selWidth >= selHeight)
        {
            sideToUse = selWidth;
        }
        else
        {
            sideToUse = selHeight;
        }
        scaleAmount = exportSizeArray[i]/sideToUse;
        return scaleAmount;
    }

    var selectionCheck = dom.selection;
    if(!selectionCheck || !selectionCheck.length)
    {
        alert("Please select a movie clip on the stage.");
    }
    else
    {
        exportSizeArray = [16, 32, 64, 128, 256, 512, 1024, 2048];

        setupExportFolder();

        if(folderLocation != null && pngFileName != null)
        {
            sel = dom.selection[0];
            dom.clipCopy();

            calculateScaleAmount(selWidth, selHeight);

            for (var i = 0; i < exportSizeArray.length; i++)
            {
                fl.createDocument();
                dom = fl.getDocumentDOM();

                dom.width = exportSizeArray[i];
                dom.height = exportSizeArray[i];

                dom.clipPaste(true);
                sel = dom.selection[0];
                dom.setAlignToDocument(true);
                selWidth = sel.width;
                selHeight = sel.height;
                calculateScaleAmount(selWidth, selHeight);

                dom.scaleSelection(scaleAmount, scaleAmount, "center");

                dom.align("vertical center", true);
                dom.align("horizontal center", true);

                URI = folderURI + "/" + pngFileName + "_" + exportSizeArray[i] + " x " + exportSizeArray[i] + "_" +".png";
                dom.exportPNG(URI, true, true);

                dom.close(false);
            }
        }
    }
}
Posted
AuthorAndrew Doll