B.8. Chapter 13 Exercise

This exercise asked you to create a simple application and then integrate both the ConnectionManager and UpdateManager classes that I have provided within the AIR Central section of http://blog.everythingflex.com.

Listing B-12 shows the ConnectionManager class. The constructor of the ConnectionManager class accepts three optional arguments. The first is a Boolean, which, when true, will show the Alert message; when a connection failure occurs, it defaults to True. The second is the URL that the ConnectionManager will attempt to connect to. It defaults to www.google.com. The last is a string that holds the Alert message. It defaults to "This application requires an Internet connection." The ConnectionManager has a public property named isConnected, which will hold the current status of the application. To use the ConnectionManager, you will simply need to create an instance of the ConnectionManager class and set any of the optional arguments. Once an instance is created, it will create an instance of the URLMonitor, which will announce any changes in status and set the isConnection property to True or False.

Listing B-13 shows the UpdateManager class. The UpdateManager examines the applicationDescriptor property of the NativeApplication.nativeApplication to determine the version of the installed application. This is then stored in the currentVersion property. The constructor accepts one required argument and one optional argument. The first required argument ...

Get Beginning Adobe® AIR™: Building Applications for the Adobe Integrated Runtime now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.