Imported image renders as big red box in Flash CS3

I was working with one of my students on Tuesday to create a filmstrip-style photo gallery where the user could move to the left or right of the filmstrip center and the line of photos would scroll into view. I was looking at the student’s .fla and when I tested their movie the photos appeared as a large red box in the SWF. Initially I thought there was a hidden layer that had a colored rectangle on it somewhere, but I soon discovered the problem — the filmstrip of photos was one huge jpeg, over 10,000 pixels wide.
While this is far beyond the maximum bitmap size that could be created with ActionScript (see this post by Keith Peters), the Flash IDE appears to handle images larger than this size when they are imported into the library (I’m not sure why Flash doesn’t complain. Anyone know?) — up to a point anyway. After some testing the red box seemed related to the RAM available to render a particular image in the Flash IDE, as I was not able to find a specific image size over which this behavior would be triggered. Sometimes a large image would render, then suddenly it would not. At any rate, should this happen to you, just reduced the size of the imported image.

November 14th, 2008 at 8:32 am
Basically, in the code for the constructor of a BitmapData there is some conditional code that says if the width or height is greater than a specific size, throw an error. In other words, the allowable size is totally artificial in that respect. However, when you import or load an external image, however the code is set up, it does not call the constructor in the same fashion. So yeah, you can create a larger bitmap.
But, the reason for the restriction is to avoid having Flash use up too much RAM. There is only so much RAM on a computer, and only so much dedicated to the browser and the Flash player. Use too much and you will crash the browser.
November 14th, 2008 at 8:39 am
Way to go Adobe. If the user enters something you don’t like, just turn it into a big red box. That makes a ton of sense, and saves the frustration of having to read an error message.
November 17th, 2009 at 11:27 pm
Yes, well i’m having this problem with a large bitmap. Big red box syndrome. I never knew of this error until i tested the swf on a slow computer that had little RAM. I wish there was a solution for this because i haven’t found one.
November 18th, 2009 at 1:43 am
Hi Ryan,
I haven’t tried this, but one workaround may be to break the bitmap up into smaller chunks and tile those to create the larger image.
July 21st, 2011 at 6:57 am
Dear Ansel,
Thankyou very much for this post. It has really helped me understand why I kept on getting those red boxes in my flash project. Would you also know why it keeps on complaining about virtual memory? I have 3gb RAM and have beefed the page file from 4000-something to 7024 mb; I have done this in increments as Flash has complained; and it still does but I haven’t increased it yet (might do though).
Best Wishes,
Nathan
July 21st, 2011 at 7:12 am
Thanks Nathan, hmm I’m not sure on the memory issue, I have not run into that myself.
August 4th, 2011 at 2:22 am
Your welcome. Is it possible for you to find out? Thanks in advance.