• Albert Banks
  • Eric Kramer
  • Jimmy Coburn
  • Krista Engler
  • Kristin Thompson
  • Les Ulmer
  • Lindsay Guinaugh
  • Michael Chatten
  • Myjive
  • Ron Edelen

I am a noob to Air. On top of this, it is also important to recognize that I am a slow adopter of Flash AS3. I have tunnel vision formed by habitual attachments to AS2 methods and it keeps me in a frustrated state of mind. Fortunately I have a few OOP-savvy cohorts that spoon-feed insightful ways of thinking. I am picking up on the basics quickly, but I am finding little resources that speak to those non-programming-centric designers.

I’m not the guy to re-invent the wheel, and Lee makes a killer wheel. Take a moment to view Lee Brimlow’s “Developing AIR in Flash” where he explains setting up your workflow for creating AIR applications. Assuming that you’re somewhat familiar with AS3 structure, Lee jumps straight into using some of the prepackaged AIR-specific classes. For me, one key step in migrating from AS2 to AS3 was getting familiar with the predefined code (functions/classes) available in CS3. A quick reference for this can be found in the top-left panel of your actions window. There is even a handy grouping specifically for Adobe Air.

AS3 AIR Methods and Classes

Developing applications in Air is no different than developing swf files for the web. Deploying functionality that can be packaged and installed on any platform (Mac/PC) make it a super-sexy way to build application-centric solutions. The advantages spawn from running a Flash-based application off the desktop and not being dependent on a web browser. The bad news is that they have to download, install, and run the app before any interactions can occur. With trends moving towards “cloud-space” and more robust browser-based web apps, I am not sure how far this will go.

We are currently working on a few cool applications and I will try to follow up with more substantial AIR tips and tools in the coming weeks. I do want to (at least) conclude this post with some AIR AS3 basics. I also recommend starting/building your own external library of .as files. This can speed up dev process when using the same code over and over. (AIR Window Control .as file).

AS3 for Window Control

// a quick and easy way to make the window draggable. I generally put a background graphic
// at the bottom layer of the stage and make it the active window area, providing opportunity
// for unique window shapes

background_mc.addEventListener(MouseEvent.MOUSE_DOWN, back_CLICK);

function back_CLICK(e:MouseEvent):void {
stage.nativeWindow.startMove();
}

// minimize the window, calls a nativeWindow class that tells the OS to minimize the active window
// the great thing about AS3 is that designers don't have to care how nativeWindow works...
// I just know that is does work.

minimize_mc.addEventListener(MouseEvent.CLICK, minimize_CLICK);

function minimize_CLICK(e:MouseEvent):void {
stage.nativeWindow.minimize();
}

// close the window, code associated with a close button with an instance name of close_mc
// this just shuts the window and stops the app from running

close_mc.addEventListener(MouseEvent.CLICK,closeButton_CLICK);

function closeButton_CLICK(e:MouseEvent):void {
stage.nativeWindow.close();
}

Leave a Comment

Your email address will not be published. Required fields are marked *

*

One Comment

  1. I guess I’m one of the OOP-savvy cohorts…