Flex 2 and Red 5 Chat Example
NOTE: This is old code and will probably not work since Red 5 has progressed. The Flex 2 code is still a good basis of how to use NetConnection and NetStream.
I have created a basic chat example using Flex 2 and Red 5. The purpose of this example is not so much about building a Red 5 server application but getting Flex 2 to work with an existing Red 5 sample server application.
All you’ll need to do is install Red 5 and make sure the samples work. You can find more information on Red 5 at http://osflash.org/red5, If you do use a non default install of Red 5 you’ll need to change the NetConnection connection URL from rtmp://localhost/fitcDemo to the appropriate value.
This basic chat example demonstrates how to force Flex 2 to use AMF0 and get around the Flex 2 NetConnection and SharedObject not being dynamic. Hopefully the example is basic enough to not require a big long walk through.
You can get the example here.
The live example is located at http://renaun.com/flex2/red5/BasicChat.html