Skip to main content
Participant
October 29, 2009
Question

Batch convert illustrator layers to movieclips

  • October 29, 2009
  • 1 reply
  • 823 views

Hello all,

Ik was wandering if it it possible to batch convert ai-layers to movieclips.Also I would like that the layer name will be the movieclip name and the instancename. Hopefully you can help me!

kind regards!

Arjan

This topic has been closed for replies.

1 reply

Participating Frequently
October 31, 2009

First of all ... yes ... it is possible to save illustrator files as movie clips(which to me are .swf).

Since i suppose you`re making a reference to .fla files(because u need instance name to be the same name as the layer and so the .fla layer it is in), that should also be possible but you`ll have to play a bit with the flash scripting. Here's a start:

this will save every layer as a swf in the same location as the .ai file ...

exportToFlashFile(app.activeDocument.path.fsName + "/export.swf");

function exportToFlashFile(destFile) {
          if ( app.documents.length > 0 ) {
               var exportOptions = new ExportOptionsFlash();
               var type = ExportType.FLASH;
               var fileSpec = new File(destFile);
               exportOptions.resolution = 150;

               exportOptions.exportStyle = FlashExportStyle.LAYERSASFILES;

               exportOptions.jpegQuality = 10;
               app.activeDocument.exportFile( fileSpec, type, exportOptions );
          }
}