Basic Construct for an Occasional Connectivity


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



Copy this code and paste it in your HTML
  1. //Basic Construct for an Occasional Connect
  2.  
  3. var url = 'http://www.adobe.com';
  4. var monitor = null;
  5.  
  6. monitor = new runtime.air.net.URLMonitor( new air.URLRequest( url ) );
  7. monitor.addEventListener( air.StatusEvent.STATUS, doNetworkStatus );
  8. monitor.start();
  9.  
  10. function doNetworkStatus( e ){
  11. if( monitor.available ){
  12. //do something
  13. }
  14. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.