giovedì, novembre 13, 2008

Flash CS3 and AIR: Monitoring Network Connectivity

This bug was really annoying. Ever had this error?

“1172: Definition air.net could not be found.” Here’s the scenario where I encountered it.

Adobe AIR has the awesome capability to monitor network connectivity.

“Adobe® AIR™ provides the means to check for changes to the network connectivity of the computer on which an AIR application is installed. This information is useful if an application uses data obtained from the network. Also, an application can check the availability of a network service.”

So far, so good. This is the troublesome part:

“The service monitor framework, separate from the AIR framework, resides in the file servicemonitor.swc. In order to use the framework, the servicemonitor.swc file must be included in your build process.

Well, perhaps you’ve just decided to copy an example that monitors the network and received this error:

1172: Definition air.net could not be found.

The answer, if you’re running Flash CS3 and have downloaded AIR Integration Kit, is to add this directory to your classpath:

C:\Program Files\Adobe\Adobe Flash CS3\AIK\frameworks\libs\air

Nice. None of this is necessary in Flex, by the way.

1 Comments:

Anonymous Anonimo said...

Add the URL Monitor class. How, you might ask? Drag the ServiceMonitorShim component from the Components panel to the Library.

(This will be available to you if you’ve downloaded the AIR update for Flash CS3.)

2. Add this import statement:

import air.net.*;

Note: if you don’t do step 1, you might get this annoying error: “1172: Definition air.net could not be found.”

11/26/2008 5:26 PM  

Posta un commento

<< Home