- XMLSocket
XMLSocket is a class in
ActionScript which allowsAdobe Flash content to use socket communication. It can be used forplain text , although, as the name implies, it was made forXML . It is often used in chat applications and multiplayer games.Examples
ActionScript 2.0
For a simple
Hello, World! application in ActionScript 2.0, you could use the code below:var xmlSocket:XMLSocket=new XMLSocket();xmlSocket.onConnect=function() { xmlSocket.send(new XML(" "));}xmlSocket.onXML=function(myXML) { trace(myXML.firstChild.childNodes [0] .firstChild.nodeValue); xmlSocket.close();}xmlSocket.connect("localhost",8463);Hello, World! This would result in the output window of the Flash IDE opening and displaying "Hello, World!", assuming that a
socket server was running on port 8463 of the local machine, and was echoing everything sent to it.
Wikimedia Foundation. 2010.