Flash Lite 2.x and 3.0 ActionScript Language Reference

GetNetworkConnectStatus fscommand2 Command

GetNetworkConnectStatus

Returns a value that indicates the current network connection status.

Note: This command is not supported for BREW devices.

Command

Parameters

Value Returned

GetNetworkConnectStatus

None

-1: Not supported.
0: There is currently an active network connection.
1: The device is attempting to connect to the network.
2: There is currently no active network connection.
3: The network connection is suspended.
4: The network connection cannot be determined.

Example

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

connectstatus = FSCommand2("GetNetworkConnectStatus");
switch (connectstatus) {
connectstatus = FSCommand2("GetNetworkConnectStatus");
switch (connectstatus) {
connectstatus = FSCommand2("GetNetworkConnectStatus"); 
switch (connectstatus) { 
 case -1 : 
 _root.myText += "connectstatus not supported" + "\n"; 
 break;
 case 0 : 
 _root.myText += "connectstatus shows active connection" + "\n"; 
 break;
 case 1 : 
 _root.myText += "connectstatus shows attempting connection" + "\n"; 
 break; 
 case 2 : 
 _root.myText += "connectstatus shows no connection" + "\n"; 
 break; 
 case 3 : 
 _root.myText += "connectstatus shows suspended connection" + "\n"; 
 break; 
 case 4 : 
 _root.myText += "connectstatus shows indeterminable state" + "\n"; 
 break; 
}