31.07.2013 Views

Building Adobe AIR Applications

Building Adobe AIR Applications

Building Adobe AIR Applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING ADOBE <strong>AIR</strong> APPLICATIONS<br />

Updating <strong>AIR</strong> applications<br />

3 Create a text file named updateConfig.xml and add the following to it:<br />

<br />

<br />

http://example.com/updates/update.xml<br />

1<br />

<br />

Edit the URL element of the updateConfig.xml file to match the eventual location of the update descriptor file on<br />

your web server (see the next procedure).<br />

The delay is the number of days the application waits between checks for updates.<br />

4 Add the updateConfig.xml file to the project directory of your <strong>AIR</strong> application.<br />

5 Have the updater object reference the updateConfig.xml file, and call the object’s initialize() method.<br />

In ActionScript, use the following code:<br />

appUpdater.configurationFile = new File("app:/updateConfig.xml");<br />

appUpdater.initialize();<br />

In JavaScript, use the following code:<br />

appUpdater.configurationFile = new air.File("app:/updateConfig.xml");<br />

appUpdater.initialize();<br />

6 Create a second version of the <strong>AIR</strong> application that has a different version than the first application. (The version<br />

is specified in the application descriptor file, in the version element.)<br />

Next, add the update version of the <strong>AIR</strong> application to your web server:<br />

1 Place the update version of the <strong>AIR</strong> file on your web server.<br />

2 Create a text file named updateDescriptor.2.5.xml, and add the following contents to it:<br />

<br />

<br />

1.1<br />

http://example.com/updates/sample_1.1.air<br />

This is the latest version of the Sample application.<br />

<br />

Edit the versionNumber, URL, and description of the updateDescriptor.xml file to match your update <strong>AIR</strong> file.<br />

This update descriptor format is used by applications using the update framework included with the <strong>AIR</strong> 2.5 SDK<br />

(and later).<br />

3 Create a text file named updateDescriptor.1.0.xml, and add the following contents to it:<br />

<br />

<br />

1.1<br />

http://example.com/updates/sample_1.1.air<br />

This is the latest version of the Sample application.<br />

<br />

Edit the version, URL, and description of the updateDescriptor.xml file to match your update <strong>AIR</strong> file. This<br />

update descriptor format is used by applications using the update framework included with the <strong>AIR</strong> 2 SDK (and<br />

earlier).<br />

Note: Creating this second update descriptor file is only necessary when you are supporting updates to applications<br />

created prior to <strong>AIR</strong> 2.5.<br />

Last updated 7/8/2013<br />

253

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!