# XML Sockets, at a loss :/

**URL:** <https://forum.kirupa.com/t/xml-sockets-at-a-loss/311595>\
**Category:** flash\
**Created:** [July 11, 2010, 10:43pm UTC](https://forum.kirupa.com/t/xml-sockets-at-a-loss/311595 "2010-07-11T22:43:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitShifter\_](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@bitShifter\_](https://forum.kirupa.com/u/bitShifter_)\
**Post date:** [July 11, 2010, 10:43pm UTC](https://forum.kirupa.com/t/xml-sockets-at-a-loss/311595/1 "2010-07-11T22:43:29Z")

</div>

Hi guys. I’ve benn trying to get a simple socket server test to work for days now and it seems I’m not getting very far.

Basically I just want to send some data from flash to the php script and have it echo it out, or anything at all like that ☹

I’ve been working from this tutorial [kirupa.com - PHP 5 Sockets with Flash 8, Page 1](http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm)

I have this basic flash class which just sends a string to the server:

```auto
package{
    
    import flash.net.XMLSocket
    import flash.display.MovieClip
    import flash.events.*
    
    public class base extends MovieClip{
        
        
        public var socket:XMLSocket;
        function base(){
            
            var socket = new XMLSocket();
            
            socket.addEventListener(Event.CONNECT,connects);
            socket.addEventListener(Event.CLOSE,closes);
            socket.addEventListener(DataEvent.DATA,getsData);
            socket.addEventListener(IOErrorEvent.IO_ERROR, errorsOut);

             
            socket.connect("website.com", 9980);
             
            socket.send("hi");
        }
        
        function connects(success){
            if(success)
            trace("connected");
            else
            trace("connection failed");
        }
        
        function closes(e){
            trace("connection dropped");
        }
        
        function getsData(e){
            trace("message:"+e);
        }
        
        function errorsOut(e){
            trace("error:"+e);
        }
    }
}

```

The server side php is the attached script (pretty much this [kirupa.com - PHP 5 Sockets with Flash 8, Page 3](http://www.kirupa.com/developer/flash8/php5sockets_flash8_3.htm))

So I keep the php running on my server then run the as class, what happens is after a while (presumably the 15 second script limit in as) I get this error:

> Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: …/networking.swf cannot load data from [website.com:9980](http://website.com:9980).  
> at base()

Any ideas what’s going wrong here? Am I just going about this completely wrong? I’m quite lost and not sure how to debug this…

Any help at all would be greatly apreciated guys 🙂 Thanks for your time.
