# XMLSocket: move objects simultanously - problem

**URL:** <https://forum.kirupa.com/t/xmlsocket-move-objects-simultanously-problem/234078>\
**Category:** flash\
**Created:** [July 30, 2007, 12:41pm UTC](https://forum.kirupa.com/t/xmlsocket-move-objects-simultanously-problem/234078 "2007-07-30T12:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![penitenziagite](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@penitenziagite](https://forum.kirupa.com/u/penitenziagite)\
**Post date:** [July 30, 2007, 12:41pm UTC](https://forum.kirupa.com/t/xmlsocket-move-objects-simultanously-problem/234078/1 "2007-07-30T12:41:27Z")

</div>

Hi  
I am having a problem with XMLSocket data sending and loading. I want to create a game like chess: two players connected, when one of them takes his move, other can see it on the screen. So I wrote the script (“circle” is a piece):

mySocket = new XMLSocket();

XMLSocket.prototype.onData = function() {  
circleBPositionX.text = bX - 25;  
circleBPositionY.text = bY - 25;  
circlePositionX.text = X - 25;  
circlePositionY.text = Y - 25;

```
circle._x = X - 25; trace("x: " +circle._x);
circle._y = Y - 25; trace("y: " +circle._y);

createEmptyMovieClip("traceRoute", 0);
    traceRoute.moveTo(bX, bY);
    traceRoute.lineStyle(3, 0xff0000);
    traceRoute.lineTo(X, Y);

```

};

circle.onRelease = function() {  
bX = \_root.circle.bX;  
bY = \_root.circle.bY;  
X = \_root.circle.X;  
Y = \_root.circle.Y;  
//mssg = bX+ "  
" +bY+ "  
" +X+ "  
" +Y+ "  
";  
mySocket.send(bX, bY, X, Y, mess);  
}

mySocket.connect(“127.0.0.1”, 9999);

The problem is when one player drags the circle, the other can see circle`s position as “undefined” (while "trace(“x: " +circle.\_x)” and "trace(“x: " +circle.\_y)” returns correct data).  
I am using PHP socket server; same as the one in [kirupa.com](http://kirupa.com) tutorial ([http://www.kirupa.com/developer/flash8/php5sockets\_flash8.htm](http://www.kirupa.com/developer/flash8/php5sockets_flash8.htm)).

Can anyone help me?
