Creating an Actionscript based AIR project in Flex Builder
The majority of the work I do is pure ActionScript, and doesn’t require the Flex framework. Its inevitable that someday one of these ActionScript projects will need to go local. In the past Zinc would have been the choice, but even the first version of AIR beats it considerably. So what do you do if you have an ActionScript project you want to do in AIR? It turns out that Flex Builder doesn’t have an option to create an ActionScript based AIR project. Luckily I’m not the only person who has run into this problem, there is an entry in the Adobe bug system detailing this exact issue. In the comments, there is a post that details exactly how to set up an ActionScript based AIR project in Flex Builder.
All you need to do is create a new Flex project, and change a file extension right before finishing set up. Once you name the project, click next. After you select the output directory, click next again and in the source path screen change the extension on the main application file from mxml to as.

After the project is created, you need to add code to have the project do anything (even create a window). Since its not done by default, here is some code to create a simple window:
mainWindow.activate();
Thats it, thanks to Laurenţiu Lozan for the solution!
6 Responses to “Creating an Actionscript based AIR project in Flex Builder”
Leave a Reply
Matt on July 20th, 2008
“In the past Zinc would have been the choice, but even the first version of AIR beats it considerably.”
Hi Chris, can you expand on that? Why do you think AIR beats Zinc.
Regards
Matt
crebstock on July 20th, 2008
Hey Matt:
Requirements can sometimes dictate one over the other, especially permissions that your users will have in their environment. But, when the choice is available, AIR beats Zinc because of support and reliability. Zinc has long touted the idea that the user doesn’t need to have Flash installed for it to work, but in the past if you didn’t have the IE flash plugin installed your Zinc based executable would crash in Windows (check out the Zinc forums for some very passionate discussion of this issue). Zinc exe’s also had a lot of trouble packaging any files into the exe you create. If you tried to create bigger than a 50 meg exe it would simply crash during creation. This of course would necessitate using an additional installation system, such as NSIS. One other issue I ran into with Zinc is the network detection. It was spotty at best, and I found that it would often give false positives on Windows environments. This is Zinc 2 that had these issues by the way. I’ve already had considerably better experiences with only the first version of AIR. Not to mention the AIR libraries are integrated right into the ActionScript API, so coding for AIR feels a lot better too. Add in all the additional support you get through labs (like the AIR update framework), and the choice is even easier. Now to be fair, Zinc (or SWFStudio) is still the way to go if your user’s can’t or won’t install software in their environment but otherwise I would choose AIR.
Chris
Laurenţiu Lozan on September 24th, 2008
“Thats it, thanks to Laurenţiu Lozan for the solution!” - You’re welcome, mate! Glad to be helpful.
Daniel Freeman on April 17th, 2009
I’m also a strong advocate of Pure ActionScript AIR applications.
Brad Manderscheid on September 14th, 2009
Awesome, thanks. I’m using flash builder 4 now and still now option for this
Ryan Stewart on September 29th, 2009
Huge thanks! It sucks we don’t have a way to do it. I hadn’t run into the problem until now, but we don’t really make it easy.
Thanks again!
=Ryan
ryan@adobe.com