I have a server that I have written in Python and I'm trying to connect to it via Flash's XMLSocket. I know for sure that this server is working properly as I have used it successfully with multiple non-Flash client applications. For right now, I just want to connect to the remote server with an SWF residing on my local disk. From what I understand, this means that I do not need a security policy file since the SWF is not in another domain. I have also confirmed that the security sandbox property of the file is set to local-trusted, so the SWF should be able to connect to servers and retrieve data from them. Here's the important code from the AS file:
var xmlSocket:XMLSocket = new XMLSocket();
public function MainLogic() {
xmlSocket.addEventListener(DataEvent.DATA, onDataReceived);
xmlSocket.connect('XXX.XXX.XXX.XXX', XXXX);
}
public function onDataReceived(event:DataEvent):void {
helloText.text = 'data received'
}
The server is programmed to send the string 'hello\0' as soon as the connection is made. But if this was happening successfully, then the default text in the dynamic textbox should be replaced with the string 'data received', which is not happening. Is it possible that I still need the policy file even though the SWF file is local?