To sit along with Ultimate's tutorial on ringing a sound as people are added to the people list in this tutorial were going to solve the same problem but by using a function call on the server side that will play a sound on all the clients side browsers.
You can adapt this to call any function you see fit, however for simplicity were going to use the situation where a client logs onto an app.

To use this tutorial you should already have built a few apps and understand how to make a connection to the server and some basic AS.

Firstly create an app called ringbell (or better still alter one of your existing apps).

In our main.asc file (this is the file on the comms server that loads the components, you will find it in the server installation directory inside the folder with your apps name, ie C:\Program Files\Macromedia\Flash Communication Server\MX\applications\my_apps_name\main.asc, for Windows users.)
we need to place the following code:

// this line is induced whenever a new connection is added to the app
application.onConnectAccept = function(){

trace("Connection accepted");

// then lets establish all the users, and loop through them calling the function
for (i = 0; i < application.clients.length; i++){
   trace ("call ring on client "+i)
   // this is the line that calls each client in turn from the application object
   application.clients[i].call("ring_my_bell");
   }
}

Now on the client side we have to create our sound, link it and then build a function for the server side script to call.
First you need to import a sound, then set it's linkage to be "my_bell_sound".
Once you have done that place the following code in the frist frame:

// connect to the server
my_nc = new NetConnection();
my_nc.connect("rtmp:/ringbell/room1");

// attach the sound
bell_sound = new Sound();
bell_sound.attachSound("my_bell_sound");

// then add the function to be called
my_nc.function= ring_my_bell(){
  //play the sound
  trace("ring bell");
  bell_sound.start();
}



The structure of this code is very simple, yet as a tool to be able to call functions across all clients on an event is a very strong peice of coding to understand. You can replace the connection accept event with any event you wish. In this next peice of code I use the above bell ring sound , but this time the trigger for it is on one of the clients browsers.

Pushbutton action
In the second part of this tutorial we are building the functionality to allow one user to push a button that rings the bell sound notifying all connected users of something.

Firstly create a button on your stage, then add the following code to it

on (release) {
   trace("send call");
   _root.my_nc.call("foo");
}

Again import a sound and set its linkage to be my_bell_sound

Then in the first frame of your movie place the following

//firstly connect to the server
my_nc = new NetConnection();
my_nc.connect("rtmp:/ringbell/01");
my_nc.onStatus = function(info) {
   trace("Level: " + info.level + " Code: " + info.code);
}

// attach the sound
bell_sound = new Sound();
bell_sound.attachSound("my_bell_sound");

// then add the function to be called
my_nc.ring_my_bell=function(){
   trace("bell ring")
   //play the sound
   bell_sound.start();
}


The important point when creating objects to be called from the server is that thie are associated with the connection object, for eaxample the above code my_nc.funcname=function(){ works however function funcname(){ wont be found from the comms server call, its to do with scope i belive.

Once again we need to crack open the main.asc file and place the following code

trace("load app")
// this gets triggered when a client connects
application.onConnect = function (clientObj) {

   // then we need to accept this connection
   
application.acceptConnection(clientObj);
   trace("connect accepted"+clientObj)

   // now we want to create the function that we call from the button being pushed
clientObj.foo=function(){
   trace("foo start")
   // loop over all clients and call ring_my_bell
   for (i = 0; i < application.clients.length; i++){
      trace("call ring "+i);
      application.clients[i].call("ring_my_bell");
      }
   }
}


And that's it. You now know how to invoke a method on all clients and you can do it from the server or from any connected client. Many Flashcom apps center around these very methods and they are one of the key features to get you started with multi user applications.