While I was trying to migrate a textChat application written in AS2 to AS3, I encountered the problem, that I couldn't use

Actionscript:
  1. nc.msgFromSrvr = function (msg) {
  2. chatPrintDebug ("msgFromSrvr "+msg);

as because the reference nc.msgFromSrvr does not work this way anymore.
I found a way on the Adobe Forums suggesting this way:

Actionscript:
  1. var connection = new NetConnection();
  2. connection.client = this;
  3. connection.connect("rtmp://localhost/application", "userName");
  4.  
  5. var remoteUsers = new SharedObject();
  6. remoteUsers = SharedObject.getRemote("users_so",connection.uri,false);
  7. remoteUsers.connect(connection);
  8. remoteUsers.client=this;
  9.  
  10. function msgFromSrvr (msg:String) { trace(msg); };

In the server-side I wrote the next code:

Actionscript:
  1. application.onAppStart = function () { application.users_so = SharedObject.get("users_so",false); }
  2. application.onConnect = function (userName) { application.users_so.send("msgFromSrvr","message_txt"); }

It worked fine.