Skip to Main Content
Adobe AIR 1.5 Cookbook
book

Adobe AIR 1.5 Cookbook

by Rich Tretola, David Tucker, Marco Casario, Koen DeWeggheleire, Koen De Weggheleire
November 2008
Beginner to intermediate content levelBeginner to intermediate
446 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Adobe AIR 1.5 Cookbook

Chapter 15. Service Monitor Framework

For desktop applications, you often need the ability to detect the status of network connectivity and monitor its changes. Some applications require a constant Internet connection, while others, called occasionally connected applications, can work offline as well as online by caching the offline content. Adobe AIR can detect network connectivity changes, thereby enabling you to plan the behavior of the application based on its status.

Including the Service Monitor Framework in an Application (JavaScript)

Problem

You want to use the service monitor framework with JavaScript to detect the status of network connectivity.

Solution

Import the service monitor framework into the AIR application.

Discussion

The service monitor framework is a separate framework from the standard AIR framework. To be able to use the service monitor framework, you need to import the servicemonitor.swf file into your HTML and JavaScript application. You can find this file in the AIR SDK’s frameworks folder. Copy servicemonitor.swf into the directory of your AIR project.

To import the file, use the script tag. The tag’s type attribute specifies the scripting language of the element’s contents and overrides the default scripting language. Set the type attribute to the application/x-shockwave-flash value, as shown here:

<script type="application/x-shockwave-flash"
src="frameworks/servicemonitor.swf"></script>

In the previous line of code, the servicemonitor.swf file resides in the frameworks ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Breaking Out of the Web Browser with Adobe AIR

Breaking Out of the Web Browser with Adobe AIR

Jeff Tapper, Michael Labriola, Peter Dilillo, Tom Kaczanko, Andriy Kupriyenko, Louie Penaflor, Mike Nimer, Nathan Weber, Steve Zimmers
Adobe AIR Programming Unleashed

Adobe AIR Programming Unleashed

Stacy Tyler Young, Michael Givens, Dimitrios Gianninas

Publisher Resources

ISBN: 9780596156145Supplemental ContentErrata Page