I just ran into a frustrating issue with Flex Builder 3 that wasted my entire morning. I did manage to track it down, however, and thought I’d share it.

I was using Flash CS3 to create a SWC with an embedded image, and then creating an instance of that image from Flex Builder 3. Flex threw an “Internal Build Error” whenever I tried to touch this image’s class. According to the build failure log, the compiler was choking up when it was trying to get symbols from the SWC.

As it turns out, when you create an extension of the BitmapData class in Flash CS3, and set it to re-encode as JPEG, Flex can no longer convert that image to a format it understands. As soon as I changed the settings to export the image as Lossless, the compiler error disappeared, and everything worked. The image works fine in Flash CS3 either way, so there must be a bug somewhere in the Flex compiler in regards to JPEG imports.