# \[FlashCS4 Actionscript 2.0\] xmlSocket.onXML and xmlSocket.onData problem

**URL:** <https://forum.kirupa.com/t/flashcs4-actionscript-2-0-xmlsocket-onxml-and-xmlsocket-ondata-problem/302960>\
**Category:** flash\
**Created:** [January 11, 2010, 3:14pm UTC](https://forum.kirupa.com/t/flashcs4-actionscript-2-0-xmlsocket-onxml-and-xmlsocket-ondata-problem/302960 "2010-01-11T15:14:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khellendros](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@Khellendros](https://forum.kirupa.com/u/Khellendros)\
**Post date:** [January 11, 2010, 3:14pm UTC](https://forum.kirupa.com/t/flashcs4-actionscript-2-0-xmlsocket-onxml-and-xmlsocket-ondata-problem/302960/1 "2010-01-11T15:14:18Z")

</div>

Hi,  
I am having a problem with reading information that is being passed from a C# server. When I use xmlSocket.onXML, the xml object being passed from the server does not have any elements at all. When I use xmlSockt.onData, I am able to get the following output with tace:  
\<?xml version=“1.0”?\>  
\<Packet xmlns:xsi="[[COLOR=#0066cc]http://www.w3.org/2001/XMLSchema-instance[/COLOR]" xmlns:xsd="[URL=“http://www.w3.org/2001/XMLSchema”][COLOR=#0066cc]http://www.w3.org/2001/XMLSchema[/COLOR]](http://www.w3.org/2001/XMLSchema-instance)"\>  
\<UserID\>5555\</UserID\>  
\<UserName\>Success\</UserName\>  
\<Operation\>RefreshUsers\</Operation\>  
\</Packet\>  
However, when I check the string variable that I used to store this string in debug mode, the value of the string is “”. And when I try to create an XML object using var my\_xml:XML = new XML(srcstring); I get the same problem as when I used the xmlSocket.onXML method. The xml object my\_xml contains no elements at all.

Can anyone help me out on this? Thank you.
