Converting fla files to xfl and vice versa to simplify copying publish settings

A really nice feature of the xfl flash file format is that (mostly) everything is text-based.

Today I was working on a small landing page project with 1 fla file that is supposed to display small variations each week for the next 6 weeks. Some of the variations are changes in graphics, and the easiest solution was to create 7 different publish settings each with different compiler constants.

Copying a publish setting will copy all the current settings, bit for some reason, the library settings pointing to the swc files used, was not copied into the new publish setting.

Instead of tediously selecting and copying every compiler constants back and forth in 7 publish settings, it was much easier and faster to convert the fla file to xfl, and edit the PublishSettings.xml with a simple search and replace.

This way you can replace a text like this:

<AS3ConfigConst>CONFIG::FLASH_AUTHORING=&quot;true&quot;;CONFIG::debug=&quot;false&quot;;CONFIG::production=&quot;true&quot;;</AS3ConfigConst>

with a text like this.

<AS3ConfigConst>CONFIG::FLASH_AUTHORING=&quot;true&quot;;CONFIG::debug=&quot;false&quot;;CONFIG::production=&quot;true&quot;;CONFIG::week34=&quot;false&quot;;CONFIG::week35=&quot;false&quot;;CONFIG::week36=&quot;false&quot;;CONFIG::week37=&quot;false&quot;;CONFIG::week38=&quot;false&quot;;CONFIG::week39=&quot;true&quot;;</AS3ConfigConst>

in the PublishSettings.xml instead of risking carpal tunnel syndrome by copying each constant and clicking a lot of gui components in the gui.

Converting a fla file into a xfl file is as easy as unzipping the fla file – it’s a zip file with the *.fla extension. Converting back is rather obvious.

I use some ant tasks to streamline the process:

<target name="Convert Xfl to Fla">
<zip destfile="${dir.flash}/${_flash.name}.fla" basedir="${dir.flash}/${_flash.name}" />
<delete dir="${dir.flash}/${_flash.name}" />
</target>

<target name="Convert Fla to Xfl">
<mkdir dir="${dir.flash}/${_flash.name}" />
<unzip src="${dir.flash}/${_flash.name}.fla" dest="${dir.flash}/${_flash.name}" />
<delete file="${dir.flash}/${_flash.name}.fla" />
</target>


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: