Decoding Flex “Unable to transcode” SWF error
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.
| Print article | This entry was posted by Caleb on November 21, 2008 at 4:02 am, and is filed under ActionScript 3, Caleb, Flex / AIR. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.
about 3 years ago
I have also same problem. I wonder if the problem is about swf file generated? Is there a trich to create swf file from fla?
If anyone know the answer or try to test in their environment, I can link the file also.
Thank you.
Asiye
about 3 years ago
The problem is that there was an error in the SWF. Double check your SWF to ensure that there are absolutely no compiler errors.
about 3 years ago
I’m an experienced Flex developer, but a Flash CS4 newbie. I thought the error “unable to transcode xxx.swf†was caused by a Flex 3/ Flash CS4 compatibility issue. I spent an entire day trying to resolve this problem. It turns out if you don’t set up the linkage on individual movie clips as “Export for ActionScript,†Flex can’t find the symbol definitions. However, and this is what messed me up, instead of just reporting that it can’t find the symbol definitions, it also reports that it can’t transcode the SWF, which led me to believe there was something wrong with the SWF. Now I know better.
about 3 years ago
I had this problem.
I’m a starter in Flex and may be you try that I will write, but it helped me.
In symbol properties i check:
“Export for action script”
“Export in frame 1″
and
enter the CLASS_NAME
After that I go to Component Definition and set the Class name as CLASS_NAME.
After this I have embended swf file and get access to my movie clip.
about 2 years ago
Thx, this article saved me a lot of time! I had the exact same problem, somehow using Background as a linking/class name creates a conflict. However the error isn’t descriptive enough to find the problem but google is
about 2 years ago
hello
must be the absolute link in the source
about 2 years ago
i had this problem too. and this worked for me.
right click the symbol in the library -> properities -> tick export for AS.
and enter the class name.
about 2 years ago
I ran into this problem and after some double checking this:
[Embed(source="PuzzleAssets.swf", symbol="Wheel2")]
changed into this:
[Embed(source="../assets/games/PuzzleAssets.swf", symbol="Wheel_2.ai")]
once I got the path right and the symbol matching the export name, then it worked. Thanks, hope this helps too!
about 1 year ago
this was my problem exactly. Thanks for the post it really helped me out. The name for my item was “background1″ haha.
about 10 months ago
Similar problem, but no CS5 compile error.
I eventually found that it was a problem with TLF Text. Not sure what the issue was, but I just changed them to Classic Text and all’s fine.
Thanks for the hint!
Flex 4 still doesn’t give any further clues : /
about 7 months ago
I found a workaround for this problem:
http://mytechieblog.blogspot.com/2011/06/error-unable-to-transcode-assetsxyzpng.html
Cheers
Aneesh