AIR has this really cool AIR Aliases library that you can include in your HTML to help keep your code less verbose. For example, to create an air window might look something like this:
var myWin = new window.runtime.flash.display.NativeWindow();
But with an AIR Alias, it can be shortened to:
var myWin = new air.NativeWindow();
Or if you are using an Encrypted Local Store:
As you can see, this removes a lot of keystrokes, especially over the course of writing a big application.
One of the best parts of using a good IDE is code assist. This is the little feature that shows you tag/code options based on what you have typed in. In CFEclipse it looks like this:
Well, Aptana has code assist for AIR (amongst all of its other languages), and it also had code assist for the AIR Aliases. This is awesome. So without Air Aliases, I would have to use code assist like this:
Which would still save a TON of typing and is awesome. But what was even better is that Aptana supports the AIR Aliases:
The ProblemSo one day, I am just sitting around, minding my own business, when all of a sudden, from out of nowhere, like I didn't expect it and suddenly, out-of-the-blue, Eclipse crashed. As you can imagine, I was stunned.
After that, part of code assist stopped working.
When I would try to use code assist from within a <script> block in an HTML file, it would look like this:
The code assist was broken. But only for the AIR Aliases, not for other AIR functionality. I tried everything I could think of, reinstalling Eclipse, reinstalling Aptana, removing the AIR plugin and putting it back. All failed. Then finally, I figured out that resetting the Aptana perspective helped. I got the code assist back.
- Included the AIRAliases.js file AND
I hope someone finds this post helpful. I wish it had existed for me yesterday when I spent 3 hours working on this.