Flash as2 chat, with sockets.

Hello I followed a tutorial here
but I can’t get the socket.bat to work.
I think it may be due to the version of php I am running.
I am posting my current code. hopefully someone can show me what Im doing wrong.

source