Hi, I'm the developer of SmartSocket, and extensible PHP socket server engine. With it, you can skip past all of your server code, and go right into the development of your project extensions!
The first SmartSocket extension, called SmartLobby, can show you how to interact between the server and the client very efficiently, even without using the SmartLobby code, or rewriting it to suit your needs, as it is Open Source!
At the time of writing this, I haven't included the basic flash class file, but I will very soon, so that people can check it out!