要能呼出相應的Adobe Air程式,除了以下的代碼外,相應的Adobe Air程式必須設置為<allowBrowserInvocation>true</allowBrowserInvocation>。

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            private var airSWF:Object;
            private var applicationID:String = 'AirAppId';
            private var publisherID:String = 'AirPubliserId';
            private var arguments:String;
 
            private function init():void
            {
                var loader:Loader = new Loader();
                var loaderContext:LoaderContext = new LoaderContext();
                loaderContext.applicationDomain = ApplicationDomain.currentDomain;
                loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
                loader.load(new URLRequest('http://airdownload.adobe.com/air/browserapi/air.swf'));
            }
 
            private function onInit(event:Event):void
            {
                airSWF = event.target.content;
                switch(airSWF.getStatus())
                {
                    case "installed" :
                        // AIR is installed
                        stage.addEventListener(MouseEvent.CLICK, onButtonClicked);
                        break;
                    case "available" :
                        // AIR is Available
                        //airSWF.installApplication(url, runtimeVersion, arguments);...
                        break;
                    case "unavailable" :
                        // AIR Not Available
                        break;
                }
            }
 
            private function onButtonClicked(event:MouseEvent):void
            {
                airSWF.launchApplication(applicationID, publisherID, arguments);
            }
        ]]>
    </mx:Script>
</mx:Application>