title: Adobe Air - Check for internet connection
body: <p>I'm building an Air app with Adobe Flash CS 5. I need to check if an internet connection is available.</p>
  
  <p>I'm running into this errors:</p>
  
  <blockquote>
    <p>1172: Definition air.net could not be found.
    1046: Type was not found or was not a compile-time constant: URLMonitor.</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>import air.net.*;
  
  var monitor:URLMonitor;
  
  function checkInternetConnection(e:Event = null):void
  {
  var url:URLRequest = new URLRequest("http://www.google.com");
  url.method = "HEAD";
  monitor = new URLMonitor(url);
  monitor.pollInterval = 3000;
  //
  monitor.addEventListener(StatusEvent.STATUS,onConnection);
  //
  function onConnection(e:Event = null):void
  {
  trace("onConnection")
  }
  //
  monitor.start();
  trace(monitor)
  } 
  </code></pre>
  
  <p>What is missing?
  Thanks.
  Uli</p>