Hi all, today I´m going to show one way of detecting internet connectivity from an AIR application.
The only thig you have to do is to use a "URLMonitor" object to start monitoring a URLRequest and listen to the StatusEvent.STATUS event, then you have to check the code in the event and this wil tell you if you have internet access at the moment or not.
I have prepared a very tiny application to show hao it works, code following this lines:
The only thig you have to do is to use a "URLMonitor" object to start monitoring a URLRequest and listen to the StatusEvent.STATUS event, then you have to check the code in the event and this wil tell you if you have internet access at the moment or not.
I have prepared a very tiny application to show hao it works, code following this lines:
I hope it helps :)
No comments:
Post a Comment