Hi, i have a problem for sockets in as3 that no data is being collected for some reason, the connection listener connects fine but the data listener doesnt retrieve anything, also it doesn't have to be xml socket heres my code:
what is wrong with the socket.addEventListener(DataEvent.DATA, onData); its not workingPHP Code:import flash.display.Sprite;
import flash.events.*;
import flash.net.XMLSocket;
var socket:XMLSocket;
function SocketTest(){
socket = new XMLSocket();
socket.connect("127.0.0.1", 4319);
socket.addEventListener(DataEvent.DATA, onData);
socket.addEventListener(Event.CONNECT, onEvent);
}
function onEvent(event:Event):void {
trace(event);
}
function onData(event:DataEvent):void {
trace(event);
}
SocketTest();




Reply With Quote