Adobe AIR - Detecting network connectivity


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private var monitor:URLMonitor;
  2.  
  3. // This is just an example of a function called after application creation complete
  4. private function handle_creationComplete():void
  5. {
  6. monitor = new URLMonitor( new URLRequest("http://www.someaddress to check against") );
  7. monitor.addEventListener( StatusEvent.STATUS, handle_status );
  8. monitor.start();
  9. }
  10.  
  11. private function handle_status ( event:StatusEvent ):void
  12. {
  13. trace(monitor.available);
  14. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.