5005: Unknown error optimizing byte code

This is a really “interesting” error message that Flash throws in the Output panel and unfortunately there is no other explanation accompanying the message. At Jumpeye we’ve had to deal a few times with this error message which seems to be generated whenever working with large .fla files that make use of rather large amounts of code.

The solution would be to turn off the Optimizer and then recompile. You can turn the Optimizer off from the Publish Settings dialog box, select Settings for the “ActionScript 3.0″ option and in that dialog box disable the “Reduce file size and increase performance” option. You can do this whenever you are working on a very large project and get this error message. In the rest of the cases, you should leave this option checked.

Another solution I’ve found on the web (didn’t test it) is to delete the .aso files generated by Flash (Control -> Delete ASO Files) .

108 thoughts on “5005: Unknown error optimizing byte code

  1. Ok, so this is my problem… I just finnished my animation in flash cs4, so I needed to make the script for the menu and all that stuff, buttons, play, pause, etc.
    I was working in AS3.
    When i tried to open the darn Actionscript 3 actions menu (F9) my flash just freezed and i had to close it the hard way.
    I tried to open again (f9) actions panel, and again freezing…
    The third time i tried F9 it went with the error: error initializing java runtime environment. you may need to reinstall flash

    Ok, i started searching for advices, found some here really interesting, haven’t tried all of em yet, but I tried a lot of advices, none worked, (except the one of the optimizer, just cant find the darn option)

    you should check this one as well
    http://www.3dbuzz.com/vbforum/showthread.php?178818-Useless-Flash-error-possible-solutions

    buttom line, i just can’t work in Action Script 3, not just my animation has the error, when i open any new file in AS3 the error comes out, laughing at me…
    It’s not just with publishing, or exporting the error appears, it appears even when i open any new AS3 file.

    Do you have some advice?, I’m starting to lose it T_T

  2. @Mrgoodkato

    I usually try to write my ActionScript code in a separat .as file and use it as a document class for the fla file so my code is separated from the animations and assets of the .fla file. I find it easier to maintain and debug.

    Also, when working on larger projects I try to organize them into several smaller .swf files so it’s easier to compile and, mainly, to work on them.

    Other than this and the advices enumerated earlier, there’s not much you can do. Indeed this problem is really annoying. But I find that if I organize my projects better, I don’t really have this problem.

  3. Thanx to NEGUSH & Tyler!

    Got it working with -Xmx1024!
    I’m building an interactive 3D Enviroment with PaperVision3D and apperantly got too much actionscript in it…

    Thanx again & Best Regards to all!

    $@D

  4. I have experienced the “Unknown error optimizing byte code” message when making Flash files with lots of Actionscript. CS5, AS3, Vista 64 bit.

    I no longer experience this error when publishing. Here are the solutions that have worked for me.

    1. Save file as Flash CS5 Uncompressed Document (.xfl) instead of an .fla
    2. Set JAVA_TOOLS_OPTIONS to -Xmx256
    3. UtilizeUILoader to externally load heavy animations or FlashEff movies.
    4. Link AS classes for each movie as external files

    Publishing blank swf files and deactivating “Compress movie” didn’t seem to have any effect.

    Thank you for this post!

  5. Thanks to everyone who put up some information about how to solve this problem!

    Another CS5 user here and we hit upon this problem after using a lot of AS files (Away3D source) and then importing some SWC files (Wacom Bamboo SDK)… just threw this error.

    Adding the JAVA_TOOLS_OPTIONS env variable, but with an -Xmx1024M (allowing 1GB of RAM usage) solved it for us.
    Only the “Delete ASO” option is still available in CS5. You can choose not to compress the movie, but no longer disable the optimizer (or at least, it’s not quickly visible).

    Thanks again!

  6. Pingback: Flash CS5 – 5005: Unknown error optimizing byte code | Gaslight Games

  7. Hello everyone,

    My FLA is 80MB Flash CS4 and I also met the same problem.
    Tried all of the solutions mentioned above to no avail.

    The only working solution for me is that you should update your Flash CS4. Download the updates from Adobe for Flash CS4 directly and install. That is working for me.

    Hope this helps you all.

  8. I tried your two solutions, and the official solution too, but it didn’t solved my problem.

    And as your information provided, I deleted some not required Library Path SWCs, and the Flash CS5 Pro stopped popping out this annoying error.

    If you guys know why, i would like to know. And hope this would be another solution for someone else.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">