Add Flex Libraries - Attach Classes

i am having some trouble with the Attach Classes option in my projects libraries.

When I add a Jar directory it is correctly adding the SWC files to my module_flex_config.xml like this
<library-path append="true">
  <path-element>flash development/common/libs/greensock_tweening.swc</path-element>

The problem is when i add a folder with just classes in it those are not getting added to the xml file.
In other words the "Attach Classes" button is adding my code to the library and to IntelliJ but not to the compiler.
So I get code completion on those classes inside IntelliJ but when I goto compile they are not being included
and i get a compiler error.

Any idea why classes are not being added to the flex_config?

Is there another way I am supposed to add a library of source code that is not a SWC?

ok I am thinking more and more this is a bug, when i add a new context root I get multiple entries in my source path
      <path-element>flash development/common</path-element>
      <path-element>flash development/games/dev/Test Game 01/src</path-element>

Attaching classes is not adding anything to the flex_config.xml big frowny face


Comment actions Permalink

IDEA compiles only those source files that belong to the project.
If some 3rd party library is distributed as swc then you may attach it as Classes to IDEA library and your sources will be compiled against it.
If 3rd party library is available only as sources then you should include these sources into the project. The best configuration is to create a separate Flex module for these sources, configure it to be compiled in swc and configure your main module to depend on this library module.

Comment actions Permalink


Thanks for getting back to me. Once i figured out that i cannot include a 3rd party library as source I did exactly as you suggested
and created a module to create a SWC from the library.

Is there any plan to change this though, if a 3rd party library is distributed as source, it would be nice to not have to deal
with compiling that code and setting up a module for something that should just drop in.

Also what is the Attach Classes option do then? I see it gives me code compeltion in the editor, but what would be the
advantage of that if it is not compiled?


Comment actions Permalink

Currently we don't have plans to change this. If 3rd party library is in sources that means that you need to compile it in any case. We hope that setting up a Flex module is not a big deal. An there's even more easy way: add library sources as a second source folder of the main module. You don't even have to copy the library under your project folder because module can have content roots anywhere on your computer.
Attach Classes allows to add a single swc file. The fact that you have full coding assistance if you attach sources is a sort of undocumented side effect.

Comment actions Permalink

Ahhhh that makes more sense, the single SWC file thing. Ok I get it..

I did also see that i could add a new contect root to my current module and add the source folder
into my module. That is also a solution,

What we were hoping to accomplish is the ability to have a library of common code that is shared amongst out developer team.

so we have our individual module source that each developer is working on, and then a folder of "common code" These would be utility
functions and managers that the whole team would share.

Having to compile this into a SWC is not a big deal it was just a little faster of a workflow when each developer could edit the common
code and just submit the code back into svn.

I understand how it needs to work now though, and we will just all get used to working that way



Please sign in to leave a comment.