A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] socket prob

  1. #1
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404

    resolved [RESOLVED] socket prob

    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:

    PHP 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.DATAonData);
    socket.addEventListener(Event.CONNECTonEvent);
    }
            
    function 
    onEvent(event:Event):void {
    trace(event);
    }

    function 
    onData(event:DataEvent):void {
    trace(event);
    }
    SocketTest(); 
    what is wrong with the socket.addEventListener(DataEvent.DATA, onData); its not working

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    I resolved the issue I think I wasn't sending data through the socket, that code still works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center