2 Replies Latest reply on Nov 9, 2010 9:22 PM by DigitalChristian

    Publishing a project with many items leads to a failure

    DigitalChristian Level 1

      I have a flash project with about 3500 items - mostly containing movie clips with linkage. The SWF acts as an external library. I publish the SWF file under AS3 + FP9 (also tried FP10) and when I tried to access the items using

      var _proAD:ApplicationDoman = loadEvent.target.applicationDomain;

      var profileClass:Class = _proAD.getDefinition(item) as Class;
      var sprite:Sprite = new profileClass();


      but all returned null! (after looping through them) - I traced the item's name in the output and they all matched exactly correctly.


      After a while, I managed to narrow down the problem which leads me to think it's a newly introduced bug in Flash CS5.


      Test1: Deleted 500 items from the project, and it worked - all items returned non-null when using the code above. Also tried deleting a different range of 500 items instead of the first 500 - which also worked. This test confirms that all items were not courrpted. Conclusion: Flash CS5 is unable to successfully publish a project containing over 3500 items in the library. The resulting SWF file size was about 500KB - which indicates it contains something, but still was unable to access the items.


      Test2: From CS5, saved the project as CS4 format and opened it with Flash CS4. Published it (via CS4), and it worked. All items returned non-null. Great. However, when I added 500 more items (total of 4000) - it failed both on CS4 and CS5.


      The publish only takes about 10 seconds. Not very long..


      Any help on this will be very much appreciated as I have already spent endless hours on this.




        • 1. Re: Publishing a project with many items leads to a failure

          I had a very similar problem with a project with lots of code and library items when I started using CS5. The thing that worked for me was setting the java (JVM) heap size to a bigger value, since in CS5 the default is a lot less than in previous versions. Interesting enough though after much searching I found there are 3 ways of doing this, and only one of them worked for me. You can either edit some values in the Windows registry, set an enviromntal variable in Windows at the system level, or edit a config file named something like "jvm.ini" which was the only one that worked for me.


          Sorry for not providing you any additional information, I don't remember the details but I hope this was at least somewhat helplful to get you in the right direction.

          1 person found this helpful
          • 2. Re: Publishing a project with many items leads to a failure
            DigitalChristian Level 1

            You're right.


            I modified the jvm.ini and increased the value from -Xmx128m to -Xmx256m. This solved the problem. Sigh, wouldn't it be nice if flash gave a error to indicate the compile was not successful and an explaination! The werid thing through is that when I published the SWF, the objects were displayed within the movieclip's timeline - but yet I am not able to access the items via linkage name!


            While this problem is solved for now, I may come across this again as more items gets added to the library.


            So, having 3.25GB of RAM, I tried using -Xmx512m and -Xmx1024m but Flash CS5 throws this error: Error initializing Java Runtime Environment when I launch the application. So, I would like to know why I can't use 512 or 1024.. I even tried restarting my machine.


            Thanks very much for your help!