Here the port number is established as 4001 and a connection is opened to the server host that is running the BroadcastServer.
The send function is used below, within the individual botton scripts, to send XML to the BroadcastServer. The other functions are connected to the default events that are generated by the XMLSocket class (onXML, onConnect, onClose, etc.).