Flash | Tips

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.