Flex - actionscript: how to add a 3rd party library

sorry for my noob question, but I'm evaluating Intellij IDEA so the interface is new to me.

I managed to add a 3rd party librarie to the module, they show up in code completion perfectly, but they are not included during the compiling and throw an error.
Does anyone have an idea what I'm doing wrong?


Comment actions Permalink

Is this 3rd party library distributed as compiled swc or in sources?
If swc the you just add it at File | Project Structure (Ctrl+Alt+Shift+S) | Modules | <your module> | Dependencies tab.
If it is only in sources then you should either compile it yourself and add in a same way,
or create a separate module in your IDEA project and keep library sources there as if it is your code (and configure dependency between modules and Flex Compiler Settings for each module).
If my answer doesn't help then please provide more details about your project configuration..

Comment actions Permalink

Thanks Alex,

in my currently workflow I define a global classpath which links to source-directories of the most common packages I use, some 3rd party, some made by myself.

In some cases compiling an swc is workable since theses sources don't change frequently.  However I couldn't find out how to compile a package into an swc with with Intellij.
Could you give a a hint on that or do I have to do it myself via Flash?

Loading the sources into a separate module and making that dependant of the main module didn't work for me either, probably too noob to Intellij...
But when searching in your forum I found a post where you suggested an even easier workflow: adding the source via a second content root folder (http://devnet.jetbrains.net/message/5259459#5259459) and that did work and is very workable so thanks anyway!

Comment actions Permalink

Hi Igor,
multimodular project setup is a good architectural solution and is very easy to configure and maintain.
Attached is a very simple project that consists of 2 modules: Lib and App. App depends on Lib. On Ctrl+F9 (Make project) Lib is compiled in Lib.swc, and then App is compiled against Lib.swc in HelloWorld.swf.

Note: you'll probably need to change Flex SDK at Project Structure (Ctrl+Alt+Shift+S) | Modules | App/Lib | Dependencies tab, because SDK may have different name on your computer.

Comment actions Permalink


that helps a lot, thank you.
I also was able to importing an existing project into a new IDEA project, so now I can really starts testing, not just playing around with a fake project.


Please sign in to leave a comment.