Groups | Blog | Home
all groups > flash (macromedia) > october 2007 >

flash (macromedia) : Are SWF files editable?


David Stiller
10/2/2007 8:48:45 PM
pcgs,

[quoted text, click to view]

As a general rule, no. SWFs are not intended to be editable, but there
are certainly ways to reverse-engineer, decompile, or otherwise conjure
assets and even complete source files from SWFs -- just like it's possible
to decompile Java apps, .NET executables, and practically any other sort of
software. Depends on how much effort you want to put into it.

As it happens, there are half a dozen or so ready-made SWF decompilers
on the market. I just had a client of my own need source material from a
SWF I hadn't worked on. We contacted the original developer, and boom ...
no source files, so I purchased one of the decompilers I've read about over
the years. It may or may not be the best one available, but it did give me
a full FLA from the provided SWF. Cost $80. SoThink SWF Decompiler.

While the resultant FLA was fully usable, I should stress that no
decompiler is able to build a perfect source file -- perfect meaning
identicaly to the original -- because certain data, such as layer names and
asset names, are discarded at compile time. So the FLA I got wasn't
organized anywhere as neatly as one I would have made myself (the Library is
riddled with text1, text2, text3, etc. instead of meaningfully named
assets). Still, it was usable in a pinch.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

David Stiller
10/2/2007 10:28:02 PM
[quoted text, click to view]

haha Walter, I had to smile when I read your Spears/monks comment. :)
Even more important, Walter hit on an interpretation of pcgs' question that
didn't even occur to me. Absolutely! As long as a SWF wasn't protected --
though protected SWFs can be unprotected, too, with 3rd party software --
then yes, it can be imported into a new FLA and edited.

Useful as that can be for some purposes, importing does convert all
motion to frame-by-frame animation, which tends to increase re-published
file size in contrast to tween-based animation. In addition, directly
imported SWFs leave behind their audio assets and any ActionScript they may
contain. In a sense, you're importing the vector equivalent of a video file
or animated GIF. Decompiling -- at least, with SoThink -- gives you a
working FLA out the gate, complete with audio, code, and just everything
(that I can see) that was in the original source file. But again, the
assets are no longer named in a useful way, and if memory serves me, neither
are those of imported SWFs. So any which way you slice it, it's best to
work with original source!

Thanks to Walter's suggestion, I'll also mention that external SWFs can
be loaded at runtime, which *does* maintain audio and coding (see the
MovieClipLoader class in the ActionScript 2.0 Language Reference or the
Loader class in the ActionScript 3.0 Language Reference). I don't think
pcgs is looking for this last approach, but now that I'm thinking outside of
the box I was stuck in last time, I thought it might be worth the mention.
:)


David Stiller
Contributor, How to Cheat in Flash CS3
http://tinyurl.com/2cp6na
"Luck is the residue of good design."

pcgs
10/2/2007 10:57:47 PM
Sometimes a client asks me to do something that I think is impossible, so I'm
asking just in case the universe has changed since the last time I poked my
head outside my office. Don't want to get caught with egg on my face.

Is it possible to edit a .swf file? I have a client that sent me a couple of
..swf files but needs a completely new sized banner ad. I could probably rebuild
the whole thing but then it would take longer than I'd like and more time than
he probably wants to pay. So I'm asking. Is it possible?

Thanks to everyone out there in the universe
dzedward
10/3/2007 1:05:40 AM
no.
Walter Elias
10/3/2007 1:06:52 AM
The universe has indeed changed. Britney Spears lost her children and monks are
being massacred in Burma.

But one thing has not changed in the universe: you can import a SWF into Flash
and edit it, if the SWF is not import-protected. Just start a blank Flash file
and "Import to stage". If the SWF is import-protected, there are numerous SWF
decompiler programs available that will do the importing for you.
pcgs
10/3/2007 1:28:11 AM
David and Walter,

Thank you for your help. For the record, I would have thanked you both on my
own. (The universe will never change so much that manners aren't important.)

For the benefit of this forum at large, I will let everyone know that I tried
Walter's suggestion and found that I did indeed manage super easily most if not
all the file's assets. But it comes in such as a frame by frame animation and
it still looks like a lot of work. The banner is quite complex. But it sure is
good to know I can at least get about half of what I need for future projects
this way. But it is a tough way to go.

The SoThink software is an option I had considered but the learning curve vs.
the proposed deadline shut that approach down pretty quick. It would be nice to
see how SoThinks decompiler stacks up to the simple Import to Stage method.
Also good to know there is somebody out there recommending it.

Thanks again.
AddThis Social Bookmark Button