Add a custom StatusBar to a WindowedApplication

To use a custom component as a statusbar it's quiet easy,
just create your component using MXML or Actionscript, it's the same, and the add this line to your WindowedApplication
statusBarFactory="{new ClassFactory(MyCustomStatusBar)}"

AIR Run-Time Font Embedding

Load and use embedded fonts at run-time.
/**
* Prepare font bundle SWF with embedded fonts.
*/
[Embed(source='../assets/Anonymous Pro B.ttf', fontName='AnonymousProB', fontWeight='bold', fontStyle='normal', mimeType='application/x-font', advancedAntiAliasing='true')]
public static var AnonymousProB:Class;

[Embed(source='../assets/Anonymous Pro BI.ttf', fontName='AnonymousProBI', fontWeight='bold', fontStyle='italic', mimeType='application/x-font', advancedAntiAliasing='true')]
public static var AnonymousProBI:Class;

[Embed(source='../assets/Anonymous Pro I.ttf', fontName='AnonymousProI', fontWeight='normal', fontStyle='italic', mimeType='application/x-font', advancedAntiAliasing='true')]
public static var AnonymousProI:Class;

[Embed(source='../assets/Anonymous Pro.ttf', fontName='AnonymousPro', fontWeight='normal', fontStyle='normal', mimeType='application/x-font', advancedAntiAliasing='true')]
public static var AnonymousPro:Class;

/**
* Load the bundle using Loader.
*/
protected function loadFonts():void {

var urlRequest:URLRequest = new URLRequest("fonts/FontBundle.swf");

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);

var loaderContext:LoaderContext = new LoaderContext();
loaderContext.allowLoadBytesCodeExecution = true;
loaderContext.applicationDomain = ApplicationDomain.currentDomain;

loader.load(urlRequest, loaderContext);

}

/**
* Register fonts and render the text field.
*/
protected function onLoaderComplete(event:Event):void {

var FontBundle:Class = ApplicationDomain.currentDomain.getDefinition("FontBundle") as Class;

Font.registerFont(FontBundle.AnonymousProB);
Font.registerFont(FontBundle.AnonymousProBI);
Font.registerFont(FontBundle.AnonymousProI);
Font.registerFont(FontBundle.AnonymousPro);

var AnonymousProBI:Class = FontBundle.AnonymousProBI;
var font:Font = new AnonymousProBI() as Font;

var textFormat:TextFormat = new TextFormat();
textFormat.font = font.fontName;
textFormat.size = 35;

var textField:TextField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
textField.defaultTextFormat = textFormat;
textField.antiAliasType = AntiAliasType.ADVANCED;
textField.embedFonts = true;
textField.multiline = true;
textField.rotation = 45;
textField.text = "The quick brown fox jumps over the lazy dog." + "\n" + new Date().toTimeString();
textField.width = 400;
textField.wordWrap = true;
textField.x = 100;
textField.y = 100;

addChild(textField);

}

Skin the WindowedApplication

The following example shows you how to extends the ProgrammaticSkin and add an image as background of your WindowedApplication positioned at the center of the window;
usage :
WindowedApplication {

borderSkin: ClassReference("com.gnstudio.skins.ApplicationSkin");

}
package com.gnstudio.skins
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;

import mx.controls.Image;
import mx.skins.ProgrammaticSkin;

public class ApplicationSkin extends ProgrammaticSkin{

[Embed(source="skin/application/bckg.jpg")]
private var imageClass:Class

private var _image:Bitmap;
private var _bitmapData:BitmapData;

override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{

super.updateDisplayList(unscaledWidth, unscaledHeight);

var backgroundColor:uint = getStyle("backgroundColor");

if(!_image){

_image = new imageClass()
_bitmapData = new BitmapData(_image.width, _image.height);
var matrix:Matrix = new Matrix();
_bitmapData.draw(_image,matrix);

}


if(unscaledWidth && unscaledWidth){

graphics.clear();
graphics.beginFill(backgroundColor);
graphics.drawRect(0, 0, unscaledWidth,unscaledHeight);
graphics.endFill();

var x:Number = unscaledWidth/2 - _bitmapData.width/2;
var y:Number = unscaledHeight/2 - _bitmapData.height/2;
var bd:BitmapData = new BitmapData(unscaledWidth,unscaledHeight,true,backgroundColor);
bd.copyPixels(_bitmapData,new Rectangle(0,0,_bitmapData.width,_bitmapData.height),new Point(x,y));
graphics.beginBitmapFill(bd, new Matrix(), false, true);
graphics.drawRect(x, y, _bitmapData.width, _bitmapData.height);

}

}

}
}

File system tree root directory

The following example shows how you can set the initial directory for the Adobe AIR FileSystemTree control by setting the directory property to a File object, which in this case is the user documents direcotry.
<mx:FileSystemTree id="tree"
directory="{File.documentsDirectory}"
width="100%" height="100%" />

Dispatch events between native windows

I was looking to a way to dispatch events between ultiple windows in an AIR application and, after I found on google only some solution that state to send a reference of the target for the event to the new window uing public properties, I came out with a more elegant solution that involves a new class added to nabiro.
The idea is that this class acts like a bridge on which is possible to register a DisplayObjetc for a specific message (i.e. the event type), the snippet represent only the simple usage of thebridge for register a new DisplayObject, attached there is the complete sample.
bridge = WindowsBridge.getInstance();
bridge.register(this, "Test");

addEventListener("Test", onTest);

// Window dispatch code
var test:WindowsBridge = WindowsBridge.getInstance();

test.dispatchEvent(new IntraWinComEvent(IntraWinComEvent.DEFAULT, new Event("Test")));