This site is now just an archive over the rise and fall of Flash. The domain is available for sale
Login | Register
FlashCom micro-tutorial

FlashCom micro-tutorial

Macromedia has put a lot of effort into the components that come with the Flash Communication Server. Drag and drop creation of applications is now reality as you will see from this tiny tutorial.

Typed up in a hurry by Jens C. Brynildsen After installing FlashCom, you can find the Components in the dropdown menu on the components panel inside Flash MX. Make sure you download the updated Component set before authoring. The Components are extremely easy to use and you can build a chat-application in less than a minute. Let me show you how to do this in 5+3 steps.

Creating the SWF
1. Create a new file in Flash MX
2. Drag the SimpleConnect component onto the stage
3. Drag the Chat component onto the stage and size it to your need.
4. Give the Chat component an instance name of chat
5. Click the SimpleConnect component and add the text chat to the Communication components list (Properties panel -> Parameters)
6. In the Application directory setting, type in either rtmp:/chat or rtmp://localhost/chat

This last setting is only correct if the server is installed on your computer. If the server is on another machine, replace the text localhost with the servers address and add /chat at the end. If you did the steps above, your properties panel should look something like this:


Setting up the server
To make it work on the server, do 3 more steps:
1. Create a folder called chat below the FlashCom applications directory.
2. Save you FLA in this folder and export it there
3. Copy the file called main.asc from one of the sample folders and into the chat-folder

Now you have created a multi-user chat. Just open the SWF and see the text shared among the users. Want to make it more fancy? Just drag more components on the stage and make sure you add them in the SimpleConnect components Communication components list.

What about letting the different users choose the color of the text in your chat? Simply drag the UserColor Component onto the stage, give it an instance name and add this to the Communication components list in the SimpleConnect component. Drag the ConnectionLight component on stage and register it with the SimpleConnect component to let the users view statistics about their connection and while you're at it, why not add video support? Add the VideoConference Component as well.

Macromedia has done a great job in tooling these components so that no programming is required. Using ActionScript, they can all be customized even further, but we'll save that for a later tutorial.


About Jens C Brynildsen

Jens has been working with Flash since version 3 came out. Since then, he's been an active member of the Flash community. He's created more than a hundred Flash games (thus the name of his blog) but he also creates web/standalone applications, does workshops and other consulting. He loves playing with new technology and he is convinced that the moment you stop learning you die (creatively speaking). Jens is also the Editor of this website.

Get new stories first

Click to follow us on Twitter!



No comments for this page.

Submit a comment

Only registered members can comment. Click here to login or here to register