Recover a Flash CS5 corrupt file: ‘Flash can not parse this document.’ - Solution

This morning I have started working again on a large project I am due to deliver in 10 days, and to my surprise, as soon as I opened the fla file, I got screwed by Flash, and had this output: "Flash can not parse this document."

In this post I explain how I managed to fix the corrupt file and get it to work again.

It is useless to say how I got "disappointed" by loosing days of work...

I am not the only one with this problem. Most people had it converting a file from CS4 to CS5, but to me it is a brand new shiny CS5 project...

What happens is that for some reason flash messes up things while saving xml descriptors of library items, and the result is a corrupt file.

So, here's a step by step solution to bring your file back to life...

I assume that you are in my same situation: all of a sudden a saved fla or xfl file cannot be opened anymore, and you get that "Flash can not parse this document." message.

  • Make a backup copy of your file.
  • If the file is in fla format, rename it from .fla to .zip, and unzip it (it will create a folder structure just as if saved in xfl format)
  • Now, open the xfl file inside the unzipped folder, and you will get the same error.
  • You will notice the LIBRARY folder. This is a hierarchical representation of your library. Go into it.
  • In my case, and most cases, the error is in one of the library items which Flash doesn't like. So, what you have to do, is delete one by one, or in groups, some library items, and then try to open the xfl again.
  • My library is paranoid ordered, so for me I had just to delete home folders going deeper and deeper, and it was easy to track the guilty library item. If you assets are all in the library root... it will take you a bit more time.
  • Everytime you delete a group of items, you have to try to relaunch the xfl file. When the right item is deleted, the file will open!!! So just continue the hunt untill you find the item or items which are causing the problem.
  • If those were unimportant items, then you can happily continue to work on your file which works again! And re-create those items.
  • If the items you had to delete were important, then instead of deleting them, mess around with the item XML untill you manage to delete the nodes causing the problem (the XML is quite easy to read and self-explanatory, so you will mostly know what you are attempting to do)
  • If you manage to remove or fix all problematic items: Et voila!!! The file is working again!

More thoughts...
Reading around, it seems that after converting from CS4 to CS5, library items which contain empty frames can cause this problem (it wasn't my case). So, most likely you will have to check nodes looking like this:
<DOMFrame index="0" keyMode="9728">
<elements />
</DOMFrame >

In my file, it was a reference to a FLVPlayback component which caused the error. So I had to remove the complete <DOMCompiledClipInstance> node and all of its contents (no, changing parameters or deleting just bindings simply didn't work).

Love and light

Flash, ActionScript, OOP, object oriented programming, freelance flash developer, actionscript developer, flash programmer, flasher, rich internet applications developer, ria, flash games, flash 3D, web applications, ActionScript 2.0, free actionscript classes, swf, free flash downloads, free flash components, flash tutorials, actionscript tutorials, flash developer beijing, programmatore flash, sviluppatore flash, sviluppatore flash italia, sviluppatore flash roma, sviluppatore flash italiano, freelance flash developer, Flash, ActionScript, actionscript, OOP, object oriented programming, freelance, actionscripter, programmer, freelance flasher, actionscript developer, rich internet applications, ria, flash games, 3D, web applications, interface developer, ActionScript 2.0, classes, swf, useability, usability, free stuff, free code, free classes, Flash Components, Flash Developer, Flash Games developer, Flash MX 2004, Flash 8, Flash Developer in Italy, Italian Flash developer, Flash Sviluppatore roma, Flash Developer Beijing, flash developer china, flash Developer Bangkok