Skip navigation
Currently Being Moderated

Pure ActionScript project for Adobe AIR

Mar 24, 2009 2:17 AM

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?)
 
Replies
  • Currently Being Moderated
    Mar 24, 2009 5:52 AM   in reply to Daniel Freeman
    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
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2009 6:36 PM   in reply to Daniel Freeman

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2009 9:19 PM   in reply to Jens Eckervogt

    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.activate();
          win.addEventListener(Event.CLOSE, function():void {
            NativeApplication.nativeApplication.exit(0);
          });
     
          win.stage.addChild(this);
     
          stage.scaleMode = StageScaleMode.NO_SCALE;
          stage.align = StageAlign.TOP_LEFT;
     
          graphics.lineStyle(1, 0, 1);
          graphics.drawCircle(100, 100, 80);
        }
      }
    }
    
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 4, 2009 1:52 AM   in reply to Gregory Lafrance

    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 ...

    at...

     

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

     

    Thanks!

     

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

     

    Suggestions:

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points