Posted By

BoNzO on 01/06/10


Tagged

AIR Flex as3


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

Demian
adrianparr
mediapoint
donaldleegraham
tspitzr
albertomori
mamzellejuu
Josueriv


Check connection in AS3


 / Published in: ActionScript 3
 

  1. import air.net.URLMonitor;
  2. import flash.net.URLRequest;
  3. import flash.events.StatusEvent;
  4.  
  5. var monitor:URLMonitor = new URLMonitor(new URLRequest(‘http://www.enginyoyen.com’));
  6. monitor.addEventListener(StatusEvent.STATUS, checkHTTP);
  7. monitor.start();
  8.  
  9. function checkHTTP(e:StatusEvent) {
  10. if (monitor.available) {
  11. test_txt.text ="Internet is available";
  12. } else {
  13. test_txt.text ="No internet connection available";
  14. }
  15. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: cristi on November 22, 2012

if you are using flash professional, you have to embed the aircore.swc from actionscript settings

You need to login to post a comment.