Skip to content

Instantly share code, notes, and snippets.

@marchbold
Last active January 15, 2016 21:35
Show Gist options
  • Save marchbold/eacac9fee2052914fb67 to your computer and use it in GitHub Desktop.
Save marchbold/eacac9fee2052914fb67 to your computer and use it in GitHub Desktop.
Determine the network availability of your application, whether it has an internet access and whether it is a cellular (WWAN) or WiFi connection
NetworkInfo.init( "" );
NetworkInfo.networkInfo.addEventListener(
NetworkInfoEvent.CHANGE,
networkChangeHandler
);
...
private function networkChangeHandler( event:NetworkInfoEvent ):void
{
trace( "isReachable=" + NetworkInfo.networkInfo.isReachable() );
trace( "isWWAN=" + NetworkInfo.networkInfo.isWWAN() );
}
// com.distriqt.NetworkInfo
@marchbold
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment