gimme a minute i go check... found:
http://www.smartfoxserver.com/
it's a game server, but you can just use the chat features of the whole package. you can replace the interface with your own designs by changing the symbols in the flash files.
if instead you want to code from scratch, you will need socket/TCP-IP programming as the back end, then transmit data to flash in the form of say.. XML...