Adobe AiR update

main Application:
[code lang="xml"]
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="" layout="absolute" initialize="checkForAppUpdate()">
import air.update.ApplicationUpdaterUI;

private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI;

// checks to see if an updated version of the app is up.

private function checkForAppUpdate():void
appUpdater.configurationFile = new File(app:/updateConfig.xml);
appUpdater.isCheckForUpdateVisible = false;
appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate);
appUpdater.addEventListener(ErrorEvent.ERROR, onError);


// if there's an error to the update show an alert

private function onError(event:ErrorEvent):void

// check to see if updated is needed

private function onUpdate(event:UpdateEvent):void

updateConfig.xml (with your src, compiled at build):
[code lang="shell"]
<?xml version="1.0" encoding="utf-8"?>

<configuration xmlns="">

<dialog name="checkForUpdate" visible="false" />
<dialog name="downloadUpdate" visible="false" />
<dialog name="downloadProgress" visible="false" />
<dialog name="installUpdate" visible="false" />
<dialog name="fileUpdate" visible="false" />
<dialog name="unexpectedError" visible="true" />
Delay is per day. .5 is half day, .02 = half an hour.
appUpdate.xml (to be placed somewhere on your site):
[code lang="shell"]
<?xml version="1.0" encoding="utf-8"?>
<update xmlns="">
This is where your description goes.


Popularne posty z tego bloga

Set up JBoss AS 5.1.0 and Seam 2.2.0 in Ubuntu 9.04