Simple Chat Application : Flash CS4 (Action Script 3.0)

October 10th, 2010 by aabhaanjan

Now we are going to develop a Chat application 🙂

Step 1 :  Server side :

C:\Program Files\SmartFoxServerPRO_1.6.6\Server

Open the Program Files folder inside that folder you will get SmartFoxServer’s   Server folder where we have to edit the config or create your own config. I am modifying the already created config according to my requirement.


Step 2:  Add zone for the application :


Here I am defining the zone name as “Simple Chat” where uCountUpdate is  counter for the number of  user . In Rooms tag as I need only one room for chatting so I have used one room as “The  Hall” , in maxUsers tag I have specified it 50 you can modify it according to your requirement and stated it public so that everyone can join it. For this I am using the extension name “chat” and the file “”. Well the is not going to do much for now but in later when I will extend this tutorial it will help us to make a follow.


Step 3:  Start the server

Now we need to start the server where in console you will get trace and the created zone. Something similar to this will be shown:


Step 4: Client Side

Now the time is for client side adventure 🙂 . As I am going to create a chat application definitely I will need some specific screens.


In the first layer of Fla  I have created the connection status movie clip named connectionStatus_MC where I have taken a dynamic text box statusMsg_txt which will show status of connection with server. On load automatically we will send the connection request to the server.


After connection we will need on more screen for  Login. So I have created this screen. I have named this login_mc. I have used one input text box loginName_txt where user will enter his name to join the chat and butt_login to send the request to the server.


Lets now design the Chat Screen here I have taken 3 sub panels. One is for Chat window chatWindow_mc, second is for user list (List component) user List_mc and third one is for the message window (msg_txt) and send button butt_send as message pad. One more button is there for butt_logOut if user wish to logout he can click on the Log Out button.

Okay .. so Now it is enough design work lets move towards the CODE  🙂

So I am starting with a document class ChatManager .  The initially it will look like this


will move forward with the code in next chapter 🙂