policy file request [Flash 11]
| Beiträge: 33 Registriert: Oct 2008
| 29.05.2012, 19:12
Hallo :)
Ich hab auf meinem PC einen SocketServer laufen und auf meinem Webserver eine SWF mit folgendem Code:
ActionScript:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | var xmlSocket:XMLSocket = new XMLSocket();
xmlSocket.addEventListener(DataEvent.DATA, onIncomingData);
xmlSocket.addEventListener(Event.CLOSE, onConnectionClosed);
xmlSocket.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
connect_btn.addEventListener(MouseEvent.CLICK, onConnectClicked);
send_btn.addEventListener(MouseEvent.CLICK, onSendClicked);
function onIOError(evt:IOErrorEvent){
trace("IO Error: " + evt);
}
function onConnectionClosed(msg:Event){
incomingChat_txt.htmlText += "Connection closed";
}
function onConnectClicked(msg:Event) {
incomingChat_txt.htmlText += "Connecting to 84.142.135.125:8080";
xmlSocket.connect("84.142.135.125", 8080);
}
function onSendClicked(msg:Event) {
if (sendChat_txt.text.length > 0) {
if(sendChat_txt.text.toLowerCase() == "exit"){
xmlSocket.send("EXITn");
} else {
var stringendo = sendChat_txt.text+"n";
xmlSocket.send(stringendo);
}
}
sendChat_txt.text = "";
}
function onIncomingData(evt:DataEvent):void {
incomingChat_txt.htmlText += "n"+evt.data;
}
|
Wenn ich mich mit dem Server verbinde bekomme ich von der swf den Input "<policy-file-request/>". Ich sende dann zurück:
ActionScript:1 | <?xml version="1.0" encoding="UTF-8"?><cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd"><allow-access-from domain="*" to-ports="*" secure="false" /><site-control permitted-cross-domain-policies="master-only" /></cross-domain-policy>
|
Doch wenn ich dann versuche über die swf was zu senden, kommt nichts beim server an...
Was mache ich falsch?
Liebe Grüße | | | Beiträge: 3000 Wohnort: Köln Registriert: Oct 2007
| 31.05.2012, 11:45
|
|