Decoding Flex “Unable to transcode” SWF error
Nov 21st
Tonight (this morning?) while catching up on some work, I was trying to embed assets created in Flash in a Flex project, using the good ‘ole Embed method. I’ve done dozens of times with excellent results, but this time was different. For some reason, my tried and true approach was generating an ambiguous error message from the Flex compiler.
It read as follows:
Unable to transcode Assets.swf
I wasted a bunch of my own time (and some of Abdul Qabiz’s) trying to figure it out, but nothing I tried seemed to work. Of course I googled for help, and the results their were even more mystifying. The only post I could find that sounded remotely close to what I was experiencing was this: http://www.codeverge.net/item.aspx?item=100658 and even though “mac_55″ was able to get it working, he had – as he put it, “No idea why it wasn’t working before.” That didn’t help much.
I started to suspect that Flash was somehow to blame, so I tried using another existing asset SWF that I had used w/ success in a previous project. Low and behold, it worked perfectly. Okay, that’s a clue… it’s somewhere in Flash.
Next, I saved the .fla that created the SWF that was working to the desktop and recompiled… then I tried using the resultant SWF in Flex again. You guessed it, it didn’t work.
Now I was really starting to think I was on to something, Flash was creating corrupt SWFs for some reason. I had crashed Flash about 10 times earlier trying to import PSDs, so I thought a restart may be in order, hopefully to resolve some phantom memory leak. So, I restarted.
After restart, I opened the previously successful, but now failing .fla and rebuilt. I noticed a ton of errors. Apparently, when I saved the .fla to the desktop, I broke the dependency chain somewhere and caused a bunch of errors. I realized that I hadn’t seen the errors before, most likely because the Output window was buried beneath a bunch of panels. Then, I opened the .fla for my apparently un-transcodable SWF – published the movie and poop, an error. Apparently “Background” is a reserved name, and my library item w/ the linkage id “Background” was causing the error. I changed the name to “BG”, it compliled fine, and worked perfectly in Flex.
The morale of the story is: if you see the “Unable to transcode” error message, make sure you’re freakin’ SWF is building properly. duh.
Hopefully someone on the Flex team can make sure that we get a more verbose error message in Flex 4.