# How to check a network connection status by flash?

**URL:** <https://forum.kirupa.com/t/how-to-check-a-network-connection-status-by-flash/149793>\
**Category:** Uncategorized\
**Created:** [June 1, 2005, 12:43pm UTC](https://forum.kirupa.com/t/how-to-check-a-network-connection-status-by-flash/149793 "2005-06-01T12:43:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LEARNING\_FLASH](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@LEARNING\_FLASH](https://forum.kirupa.com/u/LEARNING_FLASH)\
**Post date:** [June 1, 2005, 12:43pm UTC](https://forum.kirupa.com/t/how-to-check-a-network-connection-status-by-flash/149793/1 "2005-06-01T12:43:24Z")

</div>

## how to check a network connection status with flash? i found this data in help

If XMLSocket.connect returns a value of true, the initial stage of the connection process is successful; later, the XMLSocket.onConnect method is invoked to determine whether the final connection succeeded or failed. If XMLSocket.connect returns false, a connection could not be established.

Example

The following example uses XMLSocket.connect to connect to the host where the movie resides, and uses trace to display the return value indicating the success or failure of the connection.

function myOnConnect(success) {  
if (success) {  
trace (“Connection succeeded!”)  
} else {  
trace (“Connection failed!”)  
}  
}  
socket = new XMLSocket()  
socket.onConnect = myOnConnect  
if (!socket.connect(null, 2000)) {  
trace (“Connection failed!”)  
}

* * *

isthis is what i need?  
ONLY WHAT I WANT IS TO DRAW OUR NETWORK AS BUTTONS AND FLASH CHECKS EVERY DEVICE IS IT CONNECTED WELL OR NOT  
AND ACCORDING TO THAT THE BUTTON COLOR CHANGES  
IS IT POSSIBLE AND EASY WITH FLASH OR NOT???
