Adobe AIR URLMonitor Example


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



Copy this code and paste it in your HTML
  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>

URL: http://www.destroyyourcomputer.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.