# Splitting a large number of FLAs into multiple gifs

I currently have a large number (300 or so) FLAs that I wish to convert to GIFs for a HTML5 game I'm creating.

Each one of these FLAs contains multiple animations in the timeline, and they all have the same basic structure (Animation one in frames 1-25, animation 2 in frames 26-34, etc.)

Is there a way I could automate splitting them up and converting them into the GIFs?

I am on a Mac, but do have access to a Windows machine, so any solution will work, basically. I don't have the Windows version of Flash though, so that is annoying.

Thanks in advance, and if this the wrong StackExchange to ask in, then I apologise in advance.

There are a number of swf-to-png-sequence tools out there you might want to try. For example, Zoe from CreateJS is used for this purpose and may give good results for the specific way you've organized your animations.

(incidentally, you don't have to use CreateJS in order to use Zoe, although if you're making an HTML5 game you might consider it)

You should look into JSFL. It's a scripting language that you can use to interact with flas.

JSFL Reference

There's a lot you can do with it, and your problem sounds exactly like something it could solve.

var timeline = doc.getTimeline(); // Timeline

for (var i=0; i < timeline.layerCount; i++)
{
timeline.layers[i].locked = true;
}


This example locks all layers in your FLA. But there's much more you can do.

Pro Tip: In Flash (I'm using CS5), open the History window. (Window -> Other Panels -> History). All of your actions using the Flash editor, will be reported back to you in usable JSFL. You can use this to do one test case of your FLA, and then extend the script to do multiple FLAs.

Hope this helps.

IIRC Creative Suite has an "export to QuickTime" button.

Once you have a .mov file, you can use ffmpeg (available with brew or ports) to convert it to png frames or jpg frames. (ffmpeg can convert straight to gif, but is not a very good quality gif encoder).

Once you have a series of png or jpg images, you can use imagemagick to create optimised gifs from them.