Helping Flex 3 find your class in a SWC
SWCs are wonderful little digital creatures. They provide you with a compact and portable way to manage and transfer a library of classes. However, sometimes they need a little help doing their job.
I recently created a new class in the Flex Library Project that houses my core codebase. The Library Project is set up to automatically compile a SWC when it builds, this SWC is then imported in to any other projects that require the core by referencing the SWC in their build path (pretty slick little workflow). Only this time, the projects referencing the core SWC couldn’t find the class I had just added. Fail.
After trying all varieties of refreshing, cleaning, closing/opening the project, quitting/restarting Flex 3, I was beginning to wonder what had actually happened to my class. How had it gotten swallowed up in the gears of the Flex compiler?
The problem ended up being not with the new class, or the compiler, but with the .flexLibProperties. This is the XML file that stores a list of classes to include in a SWC. By default, it’s hidden from the list of files in your Flex project so you have to “un-filter” it from the Flex Navigator panel.
To do this:
• Click the downward-facing triangle icon in the upper left of the Flex Navigator panel.
• Now select “Filters…”

• Then un-check the box next to “.flexLibProperties” and the file magically appears in your project file structure.

My new class was notably absent from this list, so I included it using this syntax:
<classEntry path="core.path.path.ClassName"/>
After building the Library Project again the SWC was recompiled, now complete with my new class.