Flash Lite 2.x and 3.0 ActionScript Language Reference

GetNetworkStatus fscommand2 Command

GetNetworkStatus

Returns a value indicating the network status of the phone (that is, whether there is a network registered and whether the phone is currently roaming).

Command

Parameters

Value Returned

GetNetworkStatus

None

-1: The command is not supported.
0: No network registered.
1: On home network.
2: On extended home network.
3: Roaming (away from home network).

Example

The following example assigns the status of the network connection to the networkstatus variable, and then uses a switch statement to update a text field with the status:

networkstatus = fscommand2("GetNetworkStatus"); 
switch(networkstatus) { 
 case -1: 
 _root.myText += "network status not supported" + "\n"; 
 break; 
 case 0: 
 _root.myText += "no network registered" + "\n"; 
 break; 
 case 1: 
 _root.myText += "on home network" + "\n"; 
 break; 
 case 2: 
 _root.myText += "on extended home network" + "\n"; 
 break; 
 case 3: 
 _root.myText += "roaming" + "\n"; 
 break; 
}