Until the final version of Flex Builder 3 comes out (which should have application type as an option under new ActionScript project), there is an easy way to create an AIR application ActionScript Project with the new beta.
All you have to do is create a new Flex Project, set the Application type as AIR, and on the last screen of the new project wizard change the Main application file extension from .mxml to .as. This will then create the main .as file just like it would if you were creating a new ActionScript Project.
That’s it. Hit Debug like you would a Flex AIR application and you’re well on your way to creating an AS3-only AIR app.
The flex builder3 beta2? It does not work that way @@
@Neo:
Just checked again… sure does! 🙂
“on the last screen of the new project wizard ” that is the point
My English is not very well,and I didn’t read your article very carefully so I missed the most import information Sorry about that…
Thanks Mark 🙂
hello.
i just installed flex3 and i tried to build a AIR app like you said, but when i hit debug, nothing shows up. what am i missing ? i just started with AIR, so im trying to find out if there are anything that makes it better to build an AIR desktop application than creating a actionscript project..
i only code AS3.
Need 10 Adobe Flex engineers:
1. You should have this skill set: “Adobe Flex + C#/Java + SQL Database”.
2. You have to be living in United States, United Kingdom, Australia or Canada.
3. Work part time (through the Internet) OR full time with us (on site at our client’s office).
4. Please send us your resume, expected salary, full time or part time, etc.
Busycode Inc. is a top Adobe Flex outsourcing service provider who develops Flex/AIR applications for clients.
Visit http://www.busycode.com , you will see we are all about Flex engineer, Flex programmer, Flex coder, Flex speciallist and Flex expert. If you are Mr. Flex or Miss Flex, join us now!
ive just tried this twice on a mac with no cigar. when i compile the project the trace output is good but instead of launching a swf all i get is a little app that opens called ‘adl’. so i’m wondering: are you compiling on windows?
seems capital letters in project name are a problem
How can you create an AIR Application in an Actionscript Project with Flex Builder 3 beta?
I found the answer in Mark Walters BlogIn a nutshell
create a Flex Project
choose AIR as the application type
click next
click next again
rename the main application file from .mxml to .as
The main class extending sprite is not enough to show something on the screen. You should add a native window first that would act as a main stage.
var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
// create the window
var mainWindow:NativeWindow = new NativeWindow(windowOptions);
// activate the window
mainWindow.activate();
// adds “this” to the stage of the Window we have created
mainWindow.stage.addChild(this);
Hi, I’m trying to do just this.
Could someone post source files that do this?
Thanks!
If you wish, you could answer or send them to petruzanautico (at) yahoo,com,ar
Thanks!
helpful thanks!
Using the code Omar Fouad posted, i was able to create a Air App with flex builder, tho i had the issue when i closed my application, the debugger would still be running, so i had to manually stop de debugger with the red square (stop-button) below is a workaround for the problem.
instead of creating a new NativeWindow, i would recommend to use the stage.nativeWindow property. You should start it like this:
package {
import flash.display.Sprite;
import flash.display.NativeWindow;
public class airApp extends Sprite
{
private var m_NativeWindow:NativeWindow;
public function airApp()
{
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
private function addedToStage(e:Event):void
{
m_NativeWindow = stage.nativeWindow;
m_NativeWindow.activate();
}
}
}
Hope this is helpfull for some people 🙂
When I compile a project is not a window flash player, but I can hear sounds from SWF. Other AIR project compiles fine. AIR application also does not appear on the screen, but it can be seen in the memory.
This thread was a great help to me. Thank you.