|
Home > Archive > Macromedia Flash Server > May 2005 > Simple Call ordering users
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Simple Call ordering users
|
|
| Robert A Colvin 2005-05-27, 5:45 pm |
| Hello all I am trying to understand how to get the following to work where I can connect to a specific user:
application.onConnect= function(newClient, username, userid, webcam,
level){
newClient.username = username;
newClient.userid = userid;
application.acceptConnection(newClient);
//not sure if I should call the client and get his username
newClient.call("getusername",applyusername(),userid);
//or is there a better way to do it?
}
applyusername.onResult = function(){
//append the username to a userid?
}
Client.prototype.specifyuser = function(message,user){
for (var i = 0; i<application.newClients.length;i++){
var c=application.newClients[i];
if (c.username ==user){
c.call("seemessage",null,message);
}
}
}
It would be nice if I can make a call directly to each specific client without sending the info to everyone.
on the client I would like to be able to simply do a call:
nc.call("specificuser",null,"hello you",user);
thanx for your help in advance
---------------------------------
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| Jordan Snyder 2005-05-27, 5:45 pm |
| Create an array with userid as the key, like=20
clients[userid] =3D client
so that when someone wants to send a specific message, the client can call
nc.call("sendMessage', null, "Come get your TPS reports.", userID);
and the server code would be: =20
Client.prototype.sendMessage =3D function(msg, userID) {
clients[userID].call("receiveMessage", null, msg);
}
cheers
--=20
Jocrdan Snyder
Applications Developer
ImageAction, USA
http://www.imageaction.com
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|
|
|
|
|