DIGG IT!
Published
Tuesday, March 23, 2010
at
1:27 PM
.
There is a trick to setting up an AIR Application using ActionScript-only within Flash Builder 4. Here is how to do it:
1. File > New > "Flex Project"
2. Choose a Project Name: "Foo"
3. Select "Desktop (runs in Adobe AIR)"
4. Press "Finish"
5. Delete "Foo.mxml"
6. File > New > ActionScript Class named "Foo" with "flash.display.Sprite" as SuperClass
7. Press Finish.
8. Right Click on "Foo.as" and press "Set as Default Application"
9. In Foo.as, add this line in the constructor:
"this.stage.nativeWindow.visible = true;"
10. Run & Done!

Here is a sample "Foo" Project for Flash Builder 4:
DownloadAssuming you used the exact name of the generated MXML file, you project is 100% ready to run, debug, and profile. Within the MXMLC compiler, MXML files are translated into ActionScript classes just before compilation and if you use the same base name, they are interchangeable.
So why use ActionScript Only AIR projects? Mobile.
I have been using this workflow since pre-MAX for mobile application development. It works seamlessly with AIR on mobile.
Cheers,
Ted :)