We Recommend

Essential ActionScript 3.0 Essential ActionScript 3.0
The book focuses on the core language and object-oriented programming, but also adds a deep look at the centerpiece of Flash Player's new API: display programming. Enjoy hundreds of brand new pages covering exciting new language features, such as the DOM-based event architecture, E4X, and namespaces--all brimming with real-world sample code.


Posted By

chrisaiv on 11/26/07


Tagged

AIR


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

copyleft


Basic Construct for an Occasional Connectivity


Published in: ActionScript 3 


  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 

You need to login to post a comment.