<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="checkForUpdate()" layout="absolute"> <mx:Script> <![CDATA[ import air.update.ApplicationUpdaterUI; import air.update.events.UpdateEvent; import mx.controls.Alert; // Instantiate the updater private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI(); private function checkForUpdate():void { // The code below is a hack to work around a bug in the framework so that CMD-Q still works on MacOS // This is a temporary fix until the framework is updated // See http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=670&threadid=1373568 NativeApplication.nativeApplication.addEventListener( Event.EXITING, function(e:Event):void { var opened:Array = NativeApplication.nativeApplication.openedWindows; for (var i:int = 0; i < opened.length; i ++) { opened[i].close(); } }); setApplicationVersion(); // Find the current version so we can show it below // Configuration stuff - see update framework docs for more details appUpdater.updateURL = "http://abc.in/ote/autoupdate_testing/test.xml"; // Server-side XML file describing update appUpdater.isCheckForUpdateVisible = false; // We won't ask permission to check for an update appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError appUpdater.initialize(); // Initialize the update framework } private function onError(event:ErrorEvent):void { Alert.show(event.toString()); } private function onUpdate(event:UpdateEvent):void { appUpdater.checkNow(); // Go check for an update now } // Find the current version for our Label below private function setApplicationVersion():void { var appXML:XML = NativeApplication.nativeApplication.applicationDescriptor; var ns:Namespace = appXML.namespace(); } ]]> </mx:Script> <mx:TextArea x="0" y="0" height="64" width="480" text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque "/> <mx:TextArea x="0" y="73" height="61" width="480" text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque "/> </mx:WindowedApplication>