Posted By

allnatural on 01/22/10


Tagged

network AIR URLMonitor


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

thastyle


Adobe AIR URLMonitor Example


 / Published in: ActionScript 3
 

URL: http://www.destroyyourcomputer.com

  1. <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
  2. layout="absolute"
  3. creationComplete="init();">
  4. <mx:Script>
  5. <![CDATA[
  6. import air.net.ServiceMonitor;
  7. import air.net.URLMonitor;
  8.  
  9. private function init() : void
  10. {
  11. var urlMonitor : URLMonitor;
  12. var urlRequest : URLRequest = new URLRequest( "http://seantheflexguy.com" );
  13. urlMonitor = new URLMonitor( urlRequest );
  14. urlMonitor.addEventListener( StatusEvent.STATUS, onStatusEvent );
  15. urlMonitor.start();
  16. }
  17. private function onStatusEvent( event : StatusEvent ) : void
  18. {
  19. var evt : StatusEvent = event;
  20. trace( ">>onStatusEvent::evt.code=" + evt.code );
  21. }
  22. ]]>
  23. </mx:Script>
  24. </mx:WindowedApplication>

Report this snippet  

You need to login to post a comment.