October 21st 2007 | John Dalziel
Back in February we took a look at the Flash Optimizer from Flash tools developer, Eltima. The Frankfurt based company has just released their long awaited 'Trillix Flash Decompiler 3', so we've taken the PC version out for a spin.
What is it? SWF Decompiler utility
Platforms: Windows and Mac
Cost: $79.95, 69.95 Euros, volume bundles available
In case your unfamiliar with what they do, a decompiler will take a SWF file and generate a source FLA file from it. If you make your living as a developer you might feel there is something a little unethical about this but it's really just another tool in your arsenal. A hard drive crash or a stolen laptop is all it might take for you to loose your source files. If you can retreive your SWF files from a web server then a program like Trillix can save you days of work rebuilding your project.
Flash Decompilers have come on a bit since I last looked at them. Trillix not only installs the application but also integrates via a couple of plug-ins with Firefox and IE. I couldn't get the Firefox version to work for me but the IE version worked just fine. If you bring up the plug-in dialog you'll see a list of all the SWF files embeded on the current page. Select the file you want and you can either save or decompile it. Couldn't be simpler.
Inside the decompiler you'll see your SWF displayed in the middle of the screen and below that a contextual properties panel. Along the top is a set of tabs covering the five common tasks you'll want to perform: Manage, Extract, Convert, Edit and Search. To the right hand side you have two panels: The first has a tree structure offering a full breakdown of all the elements within the SWF. The second gives you general properties and metrics for your file. The panel on the left hand side changes depending on which tab you have selected.
Let's take a look at what you can do with those tabs.
In this mode you can select the SWF or Projector file you want to work with. These are added as 'tasks' and you can have multiple tasks on the go at any one time. This can be really useful if you two versions of the same file but your not sure which one has your latest changes in it. In this mode you can also take captures and save them to the clipboard or as a file.
In Extract mode you can pull out individual assets from your file and save them separately. Assests are tagged in the tree view and extracted to a path of your choosing. Supported assets include: Images, Shapes, Morphs, Fonts, Texts, Sounds, Videos, Buttons, Sprites, Frames and Scripts. Although scripts are saved as Actionscript (.as) files the default for the other assets is .SWF so you'll probably want to specifiy your preferred filetypes. Images can be extracted as PNGs, JPEGs and BMPs, text can be plain text, RTF or HTML, sounds can be WAV or MP3 and video can be AVI, MPEG or FLV.
This is where you convert your SWF back into an FLA. There are some nice touches in this section. Not only does it create an FLA for you, it recreates your AS2 source files and directory structure as well, then sets the class path in the FLA publish settings. Nice. As a final flourish it knocks out out a Flash project file for you.
In the Edit section you can make some minor adjustments to the assets in your SWF. It's enough to let you change some colours and the copy in a web banner for instance but any more than that and you'll want to be back inside Flash.
Lastly the Actionscript search function will look through all the code in your SWF. I can see this being really useful if you inherit one of those FLA files with a cobweb of Actionscript 1 code strewn randomly across every object. It's not going to improve the code but it might make debugging it a little less like a scene from CSI.
So that's what it can do. It's a really powerful tool and I like the interface - it's very intuitive. There are any number of reasons why you'd want to decompile your own files. Think of it as a size report on steroids. It can be really useful for slimming down your files.
One quick caveat to end on. Although Flash 9 files can be imported, the AS3 support isn't there yet. With a new compiler (AVM2) to unravel this is no small task so I'm not going to complain. According to Eltima they are working on it and hope to have it within the next few months.
John Dalziel is a founding member of FlashMagazine and regularly reports from community events in the UK. He has also written for Macromedia, New Riders, Actionscript.com and Ultrashock.com.
Book review: Flash CS3 for Dummies
Stay current on what's happening in Flash business. Sign up now for the Flashzine newsletter.