I found a fix for a single case of “Flash cannot parse this document” error when opening a file saved from Adobe Flash CS5. Here is how it happened.
A designer friend of mine upgraded to CS5 recently and sent me an email in a panic when she got this error “Flash cannot parse this document” after trying to open up a file she had just saved. While she tried to salvage some of her work from a decompiler I took a look at if we could fix the file.
Some quick Google searching came up with the right clue to figuring out what was wrong. The user wbfreek21 got me on the right path to figuring out just what happened. He talks about how he was able to fix his particular file by going into the new XML based FLA format and removing empty XML elements from the DOM here.
That’s it! Flash cannot parse this document, it’s an error in the XML! I quickly followed the instruction to open the FLA as a ZIP and started poking around in the XML files. They were large, this wasn’t a small project. Firefox has an XML parser as well but it lists out where the problem characters are, I tried opening all the files in the LIBRARY directory in Firefox and instantly found the issue. The empty character that wbfreek21 reported was this ETX (End of Text) character that had found it’s way into the document. I pulled out that character and successfully opening up the file in Flash CS5 again much to the designers joy.
Here is the step by step process I used to find and remove the problem:
- Make a copy of your corrupt FLA and put it in a fresh folder, in case you need to repeat steps
- Rename the extension on your FLA to ZIP and extract the contents to a folder
- There are several XML files in the extracted folder structure, I found my corrupt file in the LIBRARY folder but all XML files should be tested. Open each XML file in Firefox, when you reach a corrupted file you will get an error page that looks like this:
- Open that document in a text editor that can show hidden ASCII characters, I used Notepad++ but I wasn’t able to find an editor that worked for a Mac sorry, scroll to the line that Firefox reported your error on and take a look at the code in there to see what your problem area was, my XML document looked like this:
- Save your XML file with the character removed and repeat steps 3 and 4 on the same file you found an error in and the rest of the XML files in the folder structure.
- Now open up your XFL file in the root of your extracted folder structure, you shouldn’t get any errors, if you get a parse error again repeat steps 3 through 5. Use Save As to make a copy of your file as a FLA, you’re all set!
Thank you Thank you Thank you Thank you Thank you Thank you :) You saved my day thanks a million.
One notice,
I can’t find any parsing error in xml files but I have removed one xml (I try one by one) and xfl file is opened and I find why this xml can’t parse by cs5, I founded emtpy layers in this xml.
Solution :
Remove all in all xmls thats it.
Solution :
Remove all <frames/> in all xmls thats it.
Dude… damn… thank you so so so so so much… This stuff really saved my ass from working unnecessarily for a long time. I owe you a favor.
You saved my life !
Thank you so much for posting this in such a clear way–you saved my file and tons of time!!! I’m going to pop a celebratory beer and drink a toast to you!
Hi there,
How do you change the file extension to .zip.
Im working on a CS5 .fla file that has come up with this error.
Thanks.
Luke, since I don’t know what version OS your running I’m assuming Windows you can find your answer somewhere in Google show file extensions
So happy I found this article. THANK YOU. Saved me at least a dozen hours.
Sosuke
How do I open XML files in FireFox? The default is FireFox but it continues to open in IE
Us the top menu in FireFox, click on File then Open and then navigate to where your XML file is and you can always open it that way.
no se como lo hice, pero funcionó y estoy muy agradecido.
You save me from an all nighter – thanks !
Wow! I can’t believe that worked. Thank you.
I can’t tell you how happy I am this worked. You saved me so many hours during my finals week that I couldn’t afford to lose!
OMG!! You are GOD!! Now I will always make multiple saves in future.
thankzzzzzzzzzzzzzzzzzzzzzzz u saved my whole unit
thankz again n again
OMG, thank you very much man, I’ve been working on this file for a long time!
THAAAAAAAANKS
MAAAAN THANKS A MILION TIMES !!! this hellish error almost destryed my month worth of work … wow … never working with flash again … thanks !!!
Thanks alot! Swf decompilers just don’t do the trick when you have multiple nested animations..
As for the xml fix, if you stumble upon an empty frame on a layer, be sure to remove the DOMLayer tag. All I did was delete:
Thanks to Orkan too!
thank you so much!!!!
Thanks bro, you got me out of a lot of problems.
I can’t thank you enough, a month of work was saved thanks to this explanation.
Thanks- you helped me alot!!
You saved me an entire day of work!! Where’s the donate button, so I can buy you a beer, or coffee? You Rock, my friend!!
Really a life saver, I didn’t find XML Error but,
some renaming items mismatch in the library causes this.
Amazing! You saved me a bunch of time recreating the file. Thank you!
Thanks a lot!
In my case it was link on unexisting Instance. I compared broken xml with a copy it was made from and saw different.
Thanks a lot!! you made the impossible job possible..
Can’t thank you much!!