AIR Application ActionScript Project with Flex Builder 3

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.

This entry was posted in AIR. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

14 Comments

  1. Posted October 8, 2007 at 10:19 pm | Permalink

    The flex builder3 beta2? It does not work that way @@

  2. Posted October 8, 2007 at 10:31 pm | Permalink

    @Neo:
    Just checked again… sure does! :)

  3. Posted October 9, 2007 at 1:46 am | Permalink

    “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 :)

  4. Vic
    Posted March 4, 2008 at 7:38 pm | Permalink

    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.

  5. Posted April 21, 2008 at 12:59 am | Permalink

    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!

  6. richard w.
    Posted July 10, 2008 at 12:25 pm | Permalink

    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?

  7. Anonymous
    Posted September 5, 2008 at 1:34 am | Permalink

    seems capital letters in project name are a problem

  8. Posted October 15, 2008 at 12:31 pm | Permalink

    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

  9. Posted April 20, 2009 at 7:02 am | Permalink

    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);

  10. Posted May 7, 2009 at 5:20 pm | Permalink

    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!

  11. devil
    Posted May 16, 2009 at 3:08 am | Permalink

    helpful thanks!

  12. Posted June 22, 2009 at 9:41 am | Permalink

    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 :)

  13. Posted October 27, 2009 at 3:09 am | Permalink

    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.

  14. Posted November 12, 2010 at 9:50 pm | Permalink

    This thread was a great help to me. Thank you.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Pages

  • Categories

  • Archives