Flash CS5 and the new JSFL API for publishing

This is probably the most under rated and under appreciated feature of FlashIDE. But if you are a kind of person who want more flexibility,more power and more automation from FlashIDE for you and your team, you must seriously take JSFL. It makes life so much more easier.

The second thing and I again think, Adobe is moving slower in this direction, is a commandline compiler for FLA files. Well, since FLA is a binary format it was obvious to think of making a compiler for that so easily. But the good news is FlashCS5. With it comes the new flash file format XFL. I am very excited about it as it really opens up the door for a third party compiler as, this new format is a XML file with assets in respective folders. Nice move Adobe. And a whole lot of a thanks to the Flash engineering team. Only thing remains, is to see who goes there first, Adobe or the community :) to make a compiler of flash files from the commandline.

While all these will take sometime to happen, lets see whats more in store with FlashCS5 and the compiling options.

Recently I was trying to publish out a whole lot of Flash files. Well, the answer is obviously write a JSFL file and fir it up with the FlashIDE. And, its but obvious that FlashIDE will crash after compiling a bunch of files. How many, not sure to be exact about the number but if you are publishing media rich FLAs it should crash between 50 to 100, in my case with my luck it goes till 150 to 200 files. The problem is FlashIDE will open up each file and publish it and then close it. So a lot of files can quickly eat up the system memory even if you close the old files. The work arround is to break it up the files to minimal set and then publish through JSFL. This reduces the chance of crash.

The good news is with FlashCS5, there is a new API included into JSFL arsenal.

fl.publishDocument( flaURI [, publishProfile] );

This is life saver. Now Flash IDE does not even open the FLA, it only publishes the file (silently). In a more technical term Adobe says, this command opens the FLA in a headless mode. Only thing is FlashCS5 IDE has to be opened. But thats fine for now,unless we have a pure commadline compiler.

Happy Flashing :)


4 thoughts on “Flash CS5 and the new JSFL API for publishing

  1. Hi, I know another way to compile multiple .fla available since Flash pro 8 (in my case I compile specific part of a flash project(.flp) with this approach).

    I got a jsfl opening a panel (fl.getDocumentDOM().xmlPanel(“xml with a flash tag pointing to a swf presenting a panel”)). This panel(a swf file prensented in Flash IDE using some MMExecute(as2?) magic to interact with jsfl) load a resource file containing all the path to the possible fla to compile. The panel render a list with checkbox of what could be compiled.

    Then the author can select all the .fla he want to be compiled and launch the compile command.

  2. Just thought I would let you know as I was excited to hear this about CS5…

    Turns out this API was/is available for CS4 as well… it’s just undocumented.

    fl.publishDocument(“test.fla”); works fine in CS4

    Only thing I will say is that for CS4 AND CS5 I have seen it “successfully” publish file less than 1kb if flash crashes mid-publish and you restart flash and try to publish the same file again. (I have a script that does that). So make sure you check for unrealistically small files if you use this method.


  3. great util!

    I can’t use it, however. Really wish I could… but our project uses .xfl files. Your script does find these files, however the next step of buttons does not not appear. This step only appears with fla files.

    If you do decide to change this, please also ignoring version control folders like .svn and .git, and any files starting with ._ from mac’s.

    Thanks! :)

    great work.

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