I have a Flash client with which I want to connect to the server. Both use localhost and port 50,000, so there should be no problems between domains. I also set up the access network only in the publish settings. When I call the XMLSocket connection, the server seems to get a new connection. But the XMLSocket.onConnect callback does not succeed = true.
Any ideas on what might be wrong?
Here's the ActionScript to create the socket.
function myOnConnect(success) { if (success) { trace ("Connection succeeded!") inputText.text = "open"; // socket.send("1\n"); gotoAndPlay(2); } else { trace ("Connection failed!") inputText.text = "failed"; } } btnConnect.onRelease = function() { inputText.text = "started"; result = socket.connect("localhost", 50000); } socket = new XMLSocket(); socket.onConnect = myOnConnect;
actionscript flash sockets network-programming
zooropa
source share