| XML.prototype.ignoreWhite = true;
/* Create a new XMLSocket Object */ x = new XMLSocket(); x.ignoreWhite = true; /* Define an handler function to check connection */ x.onConnect = function (status) { if(status) { trace('Connection OK'); /* If connection is OK then we can identify and start sending XML */ _root.x.send('<connect nickname="test_'+random(30)+'" ></connect>'); } else { trace('No Connection'); } } /* Define an handler function to trace incoming XML */ x.onXML = function (xmlNode) { trace('Just Received : '+xmlNode); } /* Then start the connection, adjust IP and port to reflect the server information */ x.connect('127.0.0.1',2468); |