5 Replies Latest reply on Aug 4, 2009 1:52 AM by Jens Eckervogt

    Pure ActionScript project for Adobe AIR

    Daniel Freeman
      I've probably missed an obvious button or checkbox somewhere?

      I've seen that when you create a new MXML project, you have the option to target it at AIR. How do you do this for a pure ActionScript project? (Or import an existing pure ActionScript project that was written for AIR?)
        • 1. Re: Pure ActionScript project for Adobe AIR
          SwapnilVJ Level 4
          To create a new one, you have to choose Actionscript project instead of Flex project and do the rest of the process similar to that of a flex project
          • 2. Re: Pure ActionScript project for Adobe AIR
            Daniel Freeman Level 1
            "do the rest of the process similar to that of a flex project" - HOW?

            If I create a new MXML project, It gives you the option to target it at AIR. If I create a new ActionScript project - it doesn't.
            • 3. Re: Pure ActionScript project for Adobe AIR
              Jens Eckervogt Level 1

              Hello Guys,


              I know a tricks by Adobe System Inc


              !. Create new Project Flex Project!

              2. Enter your´project name and choose Air Application

              3. Click finish it!

              4. Add new Actionscript! Important your projectname should to be currect your example myappname.as

              5. See 2 different files mxml and as!

              6. Click in right in your Project -> Properties

              7. Navigate to Run/Debug Setting

              8. Mark your projectname in right side and click Button Edit:

              9. Change Application file: example myapp.mxml to myapp.as!

              10. Apply it and close it Than you close now!

              11. Set Default myapp.as to Running compile!

              12. Remove *.mxml!!

              13. Try - if you have errors - No It works fine. Like a nice trick by Adobe! Kiss at Adobe System Inc


              Thank you! Do not worry! I know now! Best Regards SnakeMedia

              • 4. Re: Pure ActionScript project for Adobe AIR
                Gregory Lafrance Level 6

                If this post answers your question or helps, please mark it as such.


                Here is the easiest way:


                1) File - New - Flex Project
                2) Give the app the name AIRActionScrip for this test project and choose AIR as the application type.
                3) Click "Next" twice.
                4) In the "Main application file:" text input, change the main application file extension from .mxml to .as.

                5) Click "Finish" and you have an AIR app in ActionScript.

                6) Edit the class definition as follows:


                package {
                  import flash.desktop.NativeApplication;
                  import flash.display.NativeWindow;
                  import flash.display.NativeWindowInitOptions;
                  import flash.display.Sprite;
                  import flash.display.StageAlign;
                  import flash.display.StageScaleMode;
                  import flash.events.Event;
                  public class AIRActionScript extends Sprite
                    public function AIRActionScript()
                      var win:NativeWindow =
                        new NativeWindow(new NativeWindowInitOptions());
                      win.addEventListener(Event.CLOSE, function():void {
                      stage.scaleMode = StageScaleMode.NO_SCALE;
                      stage.align = StageAlign.TOP_LEFT;
                      graphics.lineStyle(1, 0, 1);
                      graphics.drawCircle(100, 100, 80);
                • 5. Re: Pure ActionScript project for Adobe AIR
                  Jens Eckervogt Level 1

                  Hi Mister Lafrance,

                  But, but it is same problem with creating project after build configure mxml to as. It can to show error - i have tried anything. It can not work while java runtime kills or show a lot of errors. Like this


                  Error: ...

                  at ...



                  Please make sure my post!!! Sorry we must to configure manuel with RUN/Debug and adding as files....




                  Great nice tutorial! I hope because air developer are happy with Adobe Air Applications.



                  new functions for executing applications like this flash.system.os.exec or flash.system.exec - If you want to build distributable Air Multi Applications.

                  Application Air should to make default directory for important distributing air installers. If you want to work 1 or more application in currect directory.


                  Like this:

                  /mycompany <- that is root directory was created by frist air installer.

                  ./airapps - that new distributing air installer while you after start of air application

                  .//airapps/utilities/ <- example Air SDK should to copy into.. or nice air application like this Languagechooser or StyleChooser etc..

                  ./airapps/softwares <- your built application like Widget Builder, Splashup or IconGenerater etc..

                  ./airapps/config/ <- your currect saved config files. Important: all applications of distributing air applications will to load your currect config like Styles and Languages...

                  ./myapp Binary <- create by air installer.

                  ./shared/ <- assets,. libraries, templates and more files were created by Air installer.


                  Can you make sure for my idea of distributing air applications? We would to talk with new file for Air distributuing packages = *.airdp.


                  Thanks and best regards, SnakeMedia