Home >
IntelliJ Idea 9 For Flash Dev Overview

Advanced Flash Tactics or AFTs are techniques that come from deep within the Flash Art Of War, the oldest Flash military treatise in the world. In this AFT I will go over - Using IntelliJ Idea 9 For Flash Development. When it comes to picking an IDE, programmers tend to have closed minds about switching. I am always surprised by how dedicated some people are to products that frustrate or slows them down--simply because they learned how to work with them first. I have never really been like that, I am always looking for a better editor, and I'm happy to use several at once or switch over to another simply to take advantage of its killer features. A few weeks ago, Joa mentioned he was testing out IntelliJ's Idea Java editor for AS 3 dev. I've known IntelliJ to be an amazing Java IDE, but didn't realize it had AS3 Support. After two solid weeks of use, here are my thoughts.
What I Like
It's Not Eclipse
I hate Eclipse! There, I said it. After years of using Eclipse, I have grown so tired of the bugs, slowdowns, and general instability of the app. Mix in a few third-party plugins and it's a recipe for disaster. Not only is IntelliJ not Eclipse, but it supports Eclipse projects, specifically Flex Builder projects. Also, you can work in either Eclipse or IntelliJ with the same project files without corrupting the project. IntelliJ will automatically attempt to read the project files and link up the shared libraries. I have not tried this, but I saw the option available and that is at least a step in the right direction.
Refactor, Refactor, Refactor
I am a huge proponent of refactoring. One of the bad habits I have not been able to break from my AS 1 and 2 days is throwing lots of code in a single method just to get it up and running quickly. I have been waiting for extract to method refactoring in Flash Builder and FDT for years but IntelliJ has it out the gate. Not only that, it has several time/life-saving features to help you:
- Move - This allows you more advanced control when moving classes and files around. It will even fix paths, packages, and the constructor name.
- Rename - This allows you to rename a class and update its constructor method as well as any classes linked to it.
- Extract - There are several kinds of extractions you can do, my favorite being extract method. It allows you to select a block of code and turn it into a new method.
- Introduce - This is similar to code generation and allows you to add new variables and other pieces of code you don't feel like typing out by hand.
Code Analysis
At several points in my development, IntelliJ surprised me by its ability to analyze and suggest ways to fix my code. On a high level, you can simply run a code analysis over your entire project to see what it thinks. Things like long loops, unused imports and variables, and spelling mistakes show up in the report. One of the most important features missing from any IDE I have used is spell check. I am horrible at spelling, as you may have picked up from reading my posts, but IntelliJ can perform spellcheck as you type, even on CamelCase words. This feature alone is very helpful and is by far my favorite addition to my coding.
All Files Are Monitored By the IDE
What the hell does this mean? Let me share the following situation: IntelliJ places its html wrapper file inside of your src folder. This makes no sense, so I moved it into a bin folder. Their wrapper has the standard stuff in it, html page, swfObject, and history js. So I put all the JavaScript files in a JS folder, the swfs in their own folder, and went into the html file to fix the paths. Well, I was shocked that I didn't have to fix anything! IntelliJ was smart enough to know that I had refactored the html wrapper file and its dependent scripts, so it updated the paths for me. This is because IntelliJ fully supports HTML/JavaScript and basically every other web language out there.
IntelliJ Protects You from Making Stupid Mistakes
I love accidentally deleting files. I do it all the time when I am in one of those refactor moods and just gut everything I don't think I need. Because of this, I'm a master at SVN revert but IntelliJ doesn't let me make stupid mistakes. When I go to delete something, it tells me what other files depend on it and shows me each dependency. Not only that, but on several occasions I have seen IntelliJ rename strings containing file names in my code after I rename the physical file. To give you an example, I wanted to change "image_1.jpg" to "image1.jpg. I had an array with "image_1.jpg" in it and when I renamed the file, IntelliJ updated the array. If you have ASDoc comments above a method and you remove a parameter but keep the @param tag, IntelliJ will tell you that the comment is wrong. Moving files is also painless and a dependent always get updated, unlike in Eclipse, which attempts to make the changes, but sometimes gives up halfway through the middle of the process or throws in a Java error.
Full FlexUnit Support
That's right; you get full support for running FlexUnit tests out the gate. Although it took a while to figure out how to actually set them up, they performed exactly how I expected once they were properly configured. The test results display in the IDE and it was easy to jump to any tests that failed.
Debugger works
Not much to say here, the debugger works as expected. You make breakpoints, it stops at them, and you can see the values of properties in the application. Recently I had noticed some issues with the debugger and the latest Flex SDK. I am sure it will be worked out, but even having breakpoint and being able to see traces in the console is a huge step in the right direction.
The Kitchen Sink
I didn't spend any time talking about code completion, error checking, or code templates because IntelliJ has these features. At this point, I wouldn't even use an editor that didn't have some advanced capability to code complete the native class and my own custom ones. Most of what you would expect from Eclipse is done in IntelliJ or is better. There is no need for plugins because most of what you will ever need is built in. Version Control is tightly integrated and well laid out with support for everything you would think of from cvs, svn to git. What else can I say? It’s just a good editor. I also did some basic testing of Flex 3/4 support and was impressed. Even complex MXML classes that extend other MXMLs seemed to work fine out the gate when I couldn't get them to work in FDT 3.2 (which has basic MXML support).
What I Don't Like
Not everything is roses in IntelliJ for AS3 dev. Since it wasn't built with Flash development in mind, there are a few issues that need to be worked out or just don't make sense.
Project Is a Workspace and Other Strange Nomenclature
Project setup was hard to figure out coming from Eclipse. Projects are workspaces in Eclipse and Modules are similar to projects in Eclipse. What the hell? Plus, linking libraries such as the Flex SDK, and other projects were strange. The panel to do it is well laid out, but if you are not 100% comfortable with how to do advanced configuration of the SDK and the notion of linking libraries, you are in for a shock.
Where Are My SWFs And SWCs?
Once you get past the hurdle of setting up a module and getting it to compile, you will have a hard time finding what gets built. That is because by default they go to an output folder that is marked as hidden in the file explorer. This can easily be remedied, but is slightly annoying when you are used to the ease at which Flash Builder sets up and compiles its projects.
A Little Slow
The code completion is a little slow at times. I recently gave IntelliJ more memory but there is a noticeable delay when trying to pull up the contextual help. I am sure this will get better in time, but it's a little annoying when I know I can type faster than it takes to pull up the help.
No Profiler
All I want is a profiler, why can't I get that outside of Flash Builder? That is still Flash Builder's killer feature and why I keep it on my computer. I need to know what is going on inside my application and it is impossible to really do this without the profiler. This is not a game stopper but it's a sore spot on what could be a perfect editor.
Nothing Is Perfect
I could go on and on about the parts of the IDE I don't like, but so far the pros outweigh the cons. IntelliJ is a heavyweight just like Eclipse, and that is still my number one issue with these kinds of editors. I can't click on a file in my desktop and open it in the editor. Everything is a production—even when making a simple test project, it takes time to setup and configure.
Closing Thoughts
The last few weeks with IntelliJ have been interesting. I have almost no desire to go back to Eclipse-based editors, but I do miss the single-focused approach Flash Builder and FDT take when it comes to Flash development. Will I go back to Flash Builder or FDT? Sure, when I need to. Will I always love IntelliJ? (Probably not). I think the most important thing to keep in mind is that an IDE is just a tool. Part of my desire to be a Renaissance Developer in 2010 has a lot to do with using the right IDE for the Job. If IntelliJ is dedicated to supporting Flash and continues to improve/refine the workflow, I will be loyal until a better IDE comes along. If FDT gets better Flex Support, I will check it out. If Flash Builder improves its AS 3 editor to be superior to FDT, I am happy to give it a shot. Until then I will keep bouncing around from IDE to IDE always looking for the perfect mouse trap.
I would love to know what you think about Flash Builder, FDT or if you have started playing around with IntelliJ. I have been documenting my workflow and setup this entire time, so expect some in-depth tutorials and more feedback soon.
This post was edited by Ronda Lee Levine.




Facebook Application Development
I've been an IntelliJ IDEA user for about 6 years now. I've used it on Java, Groovy, and Grails projects very successfully. For Flex, I had previously used FB 2 and 3. Within the past two weeks I gave IntelliJ a try with the second beta of the new Flex 4 SDK. I've been very happy, but not surprised by the level of Flex support in IntelliJ IDEA. This is the type of quality I expected from JetBrains, the maker of IntelliJ and other useful developer tools. Flex devs owe it to themselves to try IntelliJ out. They have a trial version with the Flex support (you need the Ultimate edition to get Flex support, the Community edition does not provide that). I'm hoping JetBrains stays the course with the Flex support. I'm a very happy Flex developer with IntelliJ.
-- chris --
Background file indexing seems to be a really nice and usable feature, 'cause sometimes after crashes, IDEA startup is very sluggish due to total re-indexation.great job
villa bali
Great article ! I'm gonna give a try for IntelliJ.
I hate Eclipse too. Flash Builder's bugs kill me.
IntelliJ's project structure resembles what pretty much all other IDEs (except Eclipse :) do. I understand how it can be weird coming from Eclipse, but the opposite is true: using Eclipse after years of using other IDEs (Visual Studio, NetBeans, IntelliJ, Xcode, etc.) is a bit confusing at first.
>>> IntelliJ Protects You from Making Stupid Mistakes
Moreover, even if you delete file you'll be able to restore it using IntelliJ IDEA Local History. It's like version control system, remembers state of project files between operations like open/close project, refactorings, VCS commands, Run/Debug. So, if you accidentally remove something or make unwanted changes you can always roll them back. Local History has 3 days stack to remember states of your project files. Enjoy!
I have found certain aspects of IntelliJ fiddly after coming across from Eclipse but found that it is well worth the perseverance. Eclipse hacks me off and although I know I will have to keep a copy of FB as you mentioned above, I am would like to aim to spend the majority of my time in IntelliJ. There are so many neat features which I am pretty damn impressed with. I would recommend it no doubt!
Excellent Article!
Ive been quite a in and out user of IntelliJ for a few years. I first started fiddling with it back in university when learning the ways of Java, and now in the last year I decided to give it a try again as they were making beta 9 versions available with even better Flex and now AIR support.
Like you mentioned the project wrapper is a bit confusing in comparison to Flex/Flash Builder, and also the lack of the profiler. But the goodies are so many and feel so solid! I absolutely loved the refactoring/code hints, Git, Maven out-of-box support among many others.
I was also happy to have UML diagrams working great too!
And... Price!
FDT Enterprise ( only one with debugger ) = £522
Flex Builder 3 = £168 ( suspect Flash Builder will be more )
IntelliJ 9 Ultimate = £187
Cheers
I've been using IntelliJ only for a couple of months and since version 9 came out, it has replaced Flex Builder on my machine ... The thing that was annoying me the most is that I hate design view and that if you plan to play with the Flex4 SDK (without struggling too much) you need Flash Builder which is still in beta and expires quite fast ... As for FDT I find it very expensive for what it has to offer, if you're looking for an AS3 only IDE, might as well use FlashDevelop on Windows, TextMate on OSX and VI / gEdit on Linux
In terms of speed, I find IntelliJ a little bit faster, but I'm just making assumptions there.
The only downside for me is the way IntelliJ project directories are "structured", but there's probably a way to change that
It's the only sensible choice if one of your development machines is running Linux. Flex Builder on Linux is stagnant, and Flash Builder is nowhere to be seen.
I hear people are complaining about the FDT prices the most.
Powerflasher has a promotion for this month of March, "If you are using any other IDE as your flash/flex development environment, you now have the opportunity to upgrade to FDT Professional or FDT Enterprise for the special price of $299 and $399 respectively."
http://www.fdt.powerflasher.com/developer-tools/fdt-3/buy-now/promotions/
Additionally, if you buy this upgrade to FDT 3.5 version, you will get FDT 4.0 for free.
http://fdt4comfort.com
I hope this news will make a lot of people happy coders ;-)
http://jpauclair.net/2010/02/10/mmcfg-treasure/
This guy found the undocumented features of mm.cfg that enables anyone to get profiling output without flex builder.
All the more reason to leave FB behind. IntelliJ for Flex - FTW.
As a 6 year Intellij Idea user i can say that as it getting bigger and bigger and richer in features its getting slower and slower but .... There is a quite simple solution for that. As Intellij is dealing with a lot of small cache and indexes file just buy yourself even smalest SSD drive. Put Idea Instalation and projects there. Then you will notice that is almost faster than light.
I have been using Flash Develop for quite a while, has some of the features but not up to the ones listed above. I will try out IntelliJ. I have moved from FB since 2 years ago for same reasons. Eclipse IDE is ugly, bloated and just doesn't fit well for something like Flex. I'm more of a Designer/Developer and I hate seeing that ugly looking IDE.
IntelliJ I'm sure is a fine editor for AS3 development but as yet I've not used IntelliJ for that or JAVA dev. I'm not sure if it has support for JUnit testing in Java but I'm guessing it hasn't. Misunderstanding of how Eclipse can/should be used for Java development can cause frustration. But on the basis of Eclipse being Open Source and free and its amazing integration with Java as an editor, it will be hard to beat Eclipse as my own preferred editor of choice for Java development.
@colm of course it has junit support, it's a java IDE. I have not had a single crash with IntelliJ since I started using it, as opposed to at least one a day with eclipse. Each to their own and vive la difference (however it is spelt)
The EAP for Intellij X just dropped :)