ActionScript Projects Complex Setup

Hi guys,

i'm new to IDEA and am just annoyed by the performance of Adobe FlashBuilder, that's why i decided to migrate to IDEA. I work on enterprise-level software using flash, especially AIR for mobile.
I am struggling with setting up my project correctly.
I would like to briefly describe my FB 4.7 setup and maybe one of you could propose the setup for use with IDEA.

1. I have a lib-project (100s of classes and SWCs)
2. I have a number of Flashfiles for graphic Assets. Compile into numerous assests.swcs.
3. I have my main project which would include the lib (1.) as a project reference, not as SWC (this is needed for FB to dbeug properly, even if classes are in another project).  Also the main file includes the swcs from the flashfiles.

I understand that the libproject is not necessary and i could embed the sources directly but FB compiles very very slow if you do this because the libs are huge. I don't know if that would be the case with IDEA.

How would i reproduce such a setup in IDEA?

Does anyone have experience with really big projects (300+ classes and so on) using IDEA?

So i would greatly appreciate any help or maybe links to online tutorials.


Comment actions Permalink

Also to make things worse/more complicated:

The libproject is esseantially empty, all the sources it compiles are just added by adding an source-path, since they compile all the libs needed for one project. so the basic idea is to agregate all that is necessary and compile it into one single SWC wich is used in the final project and does not need to be compiled every time the main app is compiled.

Comment actions Permalink

Welcome to IntelliJ IDEA!
I met a lot of users with Flash projects having 10 000+ classes structured in 50+ IntelliJ modules. I'll do my best to help you with project setup.

As you probably got already, IntelliJ project is like Eclipse workspace and IntelliJ module is like Eclipse project. IntelliJ module of Flash type allows to setup Flex or pure ActionScript apps and libs. Each Flash module contains one or more Flash build configuration (BC). Each Flash BC has a number of settings like target platform (Web, Desktop or Mobile), output type (app or lib), SDK, dependencies, compiler options, etc. BCs can depend on each other and on 3rd party libs. Here I answered how to setup dependency on 3rd party libs (start reading from 'There are 2 types of dependency on 3rd party lib').

That's a good idea to keep source files that you edit rarely in a separate module - indeed, you'll save compilation time as it won't be recompiled if no files in that module are touched. So you configure a Flash module with one BC having Library output type. At Dependencies tab of the BC you add dependency on all 3rd party SWCs that are required to compile your own lib classes. You may change linkage type for 3rd party libe from Merged (defaut) to Included - this will make all classes from 3rd party libs included in your output SWC.

Numerous assests.swcs are already compiled in Flash CS as I understand, so for IntelliJ IDEA project they may be considered as 3rd party libs. You'll add them to the dependencies of the main app.

So, you configure a second Flash module for your main app sources. It should have one BC with App output type. At Dependencies tab of the app BC you need to configure dependency on your Lib BC and on all 3rd party libraries required to compile your main app.

Attaching a couple of screenshots for typical project structure.

Comment actions Permalink

Hi Alexander,

that was helpful thank you! I managed to set up the project like this.

However i have a few more problems:

1. I can run and compile and use the Functions embedded in the main lib. When debugging i can even step in and see the code.
BUT i cannot see its implementation when i ctrl-click on it or use the menu->goto implementation. I am forwarded to some "library.swf" where only the headers of each function are present.
(neither from the lib-module nor from the main-app module)

2. Also I cannot see the AS-Doc comments made on the lib functions. (Is ASDoc even some standard?)

3. I can live with this one. But: The lib module will not compile if it has no sorucefiles in it. I basically put an empty class and it works. Even though the lib module depends on dozens of external libs as SWCs and as raw-source files.

Is there a way to fix these issues?

Comment actions Permalink

Oh nevermind i figured it our already. The idea is to include the source folder of each library once more, putting it not under classes but under library-source. That was a bit counter intuitive, since i embed the same location twice. Anyway it works now.
Included a screenshot for anyone who might stumble upon it.

Thanks for the help!

Comment actions Permalink

I'm afraid there's still something wrong in your configuration. If you are navigated to library.swf (which is a decompiled SWC file) that means that you have configured dependency on SWC file with already compiled code. Your screenshot shows that you also configured dependency on raw AS sources. You shouldn't do both. If you have a SWC file than you need to configure only one dependency where this SWC will be under Classes root and src folder - under Sources root. Navigation, ASDoc, etc. will work.

If you configure dependency on raw AS sources -  it is enough to have them only under Classes root. Navigation, ASDoc, etc. will work as well.


Please sign in to leave a comment.