Skip to main content
Inspiring
March 15, 2022
Question

Looking for a way to script the export of individual selected layers as SWF files

  • March 15, 2022
  • 1 reply
  • 689 views

I work in animation as an After Effects compositor and part of my job is to open FLA files in Animate and manually export individual characters as SWF for importing to AE.

 

I have to open the FLA file, double click into the layer which contains the all the characters, set everything to a guide layer except the one layer I need, then export as a swf. This will give me a single character as a SWF file. If this is a character heavy scene, such as a crowd, this can get extremly tedious!

 

Is there a way to speed this up with a script? I just want to select the character I need, then run the script to export it. It can prompt me for where to save it.

 

If possible, the script would work on multiple selections, exporting multiple swfs, and assign the layer name to the file name of each swf. This is the icing on the cake though!

 

I found this script and had high hopes https://community.adobe.com/t5/animate-discussions/exporting-individual-layers-or-symbols/m-p/8842652 but it doesn't isolate the character, it exports the whole scene.

 

If you need a little more info, the top level of the FLA is set up like this…

 

The characters are nested inside this guided "FOR_COMP" layer, so I must enter that layer to access the characters. The 'Camera Move' layer is the same as FOR_COMP but with a camera move baked in for the animator to use as reference – I ignore this. Ideally the script would guide every layer here too, except for "FOR COMP", but I don't mind doing this manually.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 17, 2022

you can use this jsfl to convert all locked layers to guide layers and publish the swf which should abbreviate your work to 4 clicks:

 

var layersA = fl.getDocumentDOM().getTimeline().layers;
for(var i=0;i<layersA.length;i++){
if(layersA[i].locked) {
layersA[i].layerType = "guide";
}
}

fl.getDocumentDOM().publish();