# XML Socket

**URL:** https://forum.kirupa.com/t/xml-socket/310809
**Category:** Uncategorized
**Created:** [June 20, 2010, 4:25am UTC](https://forum.kirupa.com/t/xml-socket/310809 "2010-06-20T04:25:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Gunstar\_Hero](https://avatars.discourse-cdn.com/v4/letter/g/ecb155/32.png) [@Gunstar\_Hero](https://forum.kirupa.com/u/Gunstar_Hero)
#### Post date: [June 20, 2010, 4:25am UTC](https://forum.kirupa.com/t/xml-socket/310809/1 "2010-06-20T04:25:10Z")

</div>

I’m making a chat room, everything works, its just, when I recieve a message, I get the full xml string. How to I do it so I just get the name and input. Last site I posted on I just got flamed by some guy saying I’m a noob, so, some helpful answers please. I’m still new to this whole XML thing. As3 I can handle 😃

Code so far:

```auto
var mySocket:XMLSocket=new XMLSocket();
var username:String="Gunstar"
mySocket.connect("192.168.1.104",5525);
btn.addEventListener(MouseEvent.MOUSE_DO WN,sendData);
function sendData(event:Event) {
mySocket.send("<?xml version=\"1.0\"?><Chat><Info channel=\"channel1\" user=\"" + username + "\" data=\""+input.text+"\" /></Chat>")
}
mySocket.addEventListener(DataEvent.DATA ,recieve)
function recieve(event:DataEvent){
field.text+=event.data
}

```
