We have a series of JSL scripts that export our ad banners in both SWG and GIF format. The GIFs are compiled by exporting each of the 3 frames of the SWF as PNG images then a .jsx script runs in Photoshop and compiles them into a GIF.
This all worked fine in Flash CS4. Running the script on FLAs in FLash CS5.5 produces this error at the PNG export stage:
The bitmap is too large. The largest bitmap that can be created is 8000x8000 pixels.
The line of code that triggers this error is:
fl.getDocumentDOM().exportPNG((pngPath+resName+".png"), true, false);
The path variables are fine and produce a valid path (see below). As you know the first boolean states whether to 'use current PNG export settings' (true) or to show the settings dialog on export (false). The second Boolean states whether to export only the current frame (true) or all frames in the SWF (false).
If I change the 'use current PNG export settings' to false and show the export dialog and OK the default values the export runs fine (which is how I know there is no issue with the export path).
Showing the dialog box on each export is not acceptable because we have over 10,000 of these banners to export over the next couple of months.
I'd like to know:
 Is this an actual bug?
 Can anyone suggest a workaround?
To reproduce this behaviour create an FLA in CS4, make 3 keyframes, draw a filled rectangle (or whatever) on each frame then save it somewhere (ie C:\test.fla)
exportPath = fl.scriptURI.substr(0,fl.scriptURI.lastIndexOf("/"))+"/";
fl.getDocumentDOM().exportPNG(exportPath+"Frame.png", TRUE, FALSE);
The first line of code here just gets the location of the jsfl file and removes the filename to give an export path.
The second line export each frame to the same location as the FLA and JSFL files.
This should run fine in CS4 and you will see the following in your save location:
If you change the first boolean in the export command to FALSE and run the script again you should see the PNG export settings dialog box and when you OK it you will get the same export result.
Now open the FLA and JSFL files in CS5.5 and run the JSFL. With the boolean set to TRUE you should get an error (the 8000px error), however if you set it to FALSE so that you get the settings dialog when you OK it the export will run fine.
Change it back to TRUE and you will get an error again.
I also found that switching the 'current frame only' flag (second Boolean) to TRUE works fine in CS5.5 - it only complains about the bitmap size if I try to export a series of frames, it's fine with just one frame.
This means, of course, that a workaround is to loop through the frames and export each one, which is fine and works OK but it takes 10 seconds compared to the split second that CS4 takes to export the series.
10,000 x 10 extra seconds = 27.77 extra hours of publish time!
Just downloaded the Flash Professional CS6 trial and the same thing happens.
Guess I'll just have to put this down to a bug that's not going away any time soon.
We're now on the hunt for CS4 licenses for a couple of new machines that will be used to export these banners.