During a recent project, I was compiling and testing Adobe Flex .mxml files for a web application. The compiled .swf files worked fine at first, but then I started to get an “Error #2046″ and my .swfs would fail to load. The fix was much easier than I expected, but it was still a pointless setback. Here’s how to fix error 2046:
If you’re not a developer and you want to fix this error in your browser, go to the Adobe Global Settings website or (on your computer) Start>Settings>Control Panel>Flash Player, click the Global Storage Settings tabs and increase your storage space to 10MB. If the error still comes up, drag the slider down to zero, uncheck “Store common flash components to reduce download times” and drag the slider back up to 10MB. Then go to your browser’s settings and clear your cache.
If that doesn’t work and reinstalling flash doesn’t work, I don’t know what to tell you.
For Flex/ActionScript developers:
Adobe’s website says Error 2046 “indicates that the loaded RSL was not signed properly. In the case of framework RSLs, the framework’s SWZ file that the application attempted to load at run time was not a properly signed SWZ file. You must ensure that you deploy an Adobe-signed RSL.”
I was only using Adobe signed, framework RSLs and they worked just fine until something weird happened somewhere between mxmlc and Flash player. At compile time, mxmlc dynamically links your application to the RSLs it needs, and Adobe requires the signatures to check out to insure that flash player isn’t running RSLs that contain bad code.
By statically linking RSLs at compile time with the flag “-static-link-runtime-shared-libraries=true” I was able to fix error #2046. To compile my mxml, I typed
$ mxmlc -static-link-runtime-shared-libraries=true [my filename].mxml
and the compiled swf ran just fine. The only downside is that the compiled swf is much larger than a dynamically linked swf. Sometimes, when I set my local flash storage to zero, deleted my flash cache and then set local storage back to 10 megabytes, everything worked fine when I recompiled. In my case, this appeared to be a quirk in flash player.
Hopefully this will save you some time.