Internal Build Error: Flash -> SWC + Flex = BitmapData Insanity

I thought I would present a problem I seem to be having consistently in Flex builder, and see if anyone is searching for like issues.

For some reason, Flex Builder is not handling Bitmap Data with any sort of consistency when it is included as a class in a SWC exported from Flash. In my opinion, using SWCs to import visual content from the Flash IDE, is for the most part a fluid and excellent work flow. However, every once in a while, in seemingly inexplicable fashion, I get internal build errors.

The insanity of this is that I can’t find a pattern. It happens mainly on library objects exported as BitmapData, but not consistently. In one project for instance, I received an internal build error, and was able to whittle the problem down to one tiny BitmapData culprit in a library of about 40 like classes.

By eliminating the offending class, my Flex ActionScript Project compiles…. if I don’t, Flex blows up and I get an “internal build error.” There are annoying workarounds, like embedding the Bitmap into the ActionScript Class, but this ruins the fluidity of a work-flow between Flash and Flex.

Anyway, the whole thing throws a monkey wrench into the system, and is overwhelmingly irritating. I wish I could post a solution, but I haven’t been able to nail down the real problem. Also, there seems to be next to nothing concerning this problem on the web.

A colleague mentioned that it might have something to do with the sensitivity of the Eclipse Framework, but god only knows at this point. So, there you have it. I may be the only one wrestling with this issue, and I may never receive a comment on this post, but hopefully someone out there knows what I’m talking about and can share in my pain.

————————————

This is a simplified version of including a SWC file in a flex project… you can read the complete document at Adobe’s LiveDocs

Add an SWC file to the library path

  1. With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
  2. Click on the Library tab.
  3. Select the Add SWC option
  4. Enter or browse to and select the location of the SWC file, project, or folder. Click OK.The SWC file, library project, or folder is added to the library path.

4 Responses to “Internal Build Error: Flash -> SWC + Flex = BitmapData Insanity”

  1. SaltamonteZ Says:

    I have exactly the same problem and it drives me crazy. So you´re not alone :( . I´ll go on searching the net hoping to solve this :/

  2. Andrew Traviss Says:

    I just ran afoul of this problem, and I figured out what was causing it. It turns out that Flex does not play nice with Flash CS3′s JPEG encoding. If you are going to retrieve an image from a SWC in Flex, then that image must be published as Lossless in Flash.

  3. xero / the.fontvir.us Says:

    yup. this is becoming a “know issue” among as3 developers. it has been throughly disscussed on the papervision3D mailing list. theres also another flex+swc issue i keep having w/ flex ignoring flash’s scale9grids.

  4. Matt Rix Says:

    I started having this error again, and just did some tests with this… It will occur 99% of the time if the class is being initialized statically, and even if you avoid doing that, it still happens. I found that once the jpeg compression was set to over 80% or so in flash, that the problem stopped happening. Very odd, but it definitely seems to jive with andrew’s comment above.

Leave a Reply