Skip to main content
Participating Frequently
October 20, 2008
Question

connecting tow user with each other

  • October 20, 2008
  • 5 replies
  • 548 views
hello every one,
any one know any thing about private chat plz give me some help i want to complete my final year project. how we can connect two users with each other so that they can do the private chat.
thanks in advance
    This topic has been closed for replies.

    5 replies

    October 27, 2008
    When you invoke the call method on a specific client, only that client receives the call. Have you read the documentation?
    Participating Frequently
    October 28, 2008
    documentation of flash media server? ok i will then i tell you thanks for your help i will tell you either i have done it or not.
    can you please tell then how can i creat a folder on the server with the username? i am waiting for your reply. thanks dear. thanks again.
    October 24, 2008
    Since you're sending your messages over a shared object, you'll need to handle the private messages a bit differently.

    Ideally, you don't want to send the private messages over the shared object, as that would mean everyone subscribing to the SO would receive them (even if they aren't being displayed, but that would be a waste of bandwidth and a security issue). You'd be better served sending the private message through a client call, and handing that separately on the client side. For example:

    Server side:

    function sendPrivateMessage(client, msg){
    client.call("receivePrivateMessage", null, msg)
    }

    Client side

    my_netconnection.receivePrivateMessage = function(msg){
    // Code to display the private message goes here
    }
    Participating Frequently
    October 27, 2008
    how this msg will be received only by that particular user. i am a bit confused about this.

    i want to creat a folder on the server side can i creat it with the user name i am thankful to you if you can help me. thanks in advance.
    October 22, 2008
    If find the best approach to be assigning a unique ID to each client when the connect:

    application.idCount = 0;

    application.onConnect = function(clientObj){
    clientObj.uid = application.idCount++;
    }

    Then, you can loop through the clients array to find a particular client when you need to

    findClient = function(uid){
    for(var a=0; a<application.clients.length; a++){
    if(application.clients.uid == uid){
    return application.clients
    ;
    break;
    }
    }
    return "client not found";
    }

    In the function above, we're looking for a client who has a property "uid" that matches the value passed to the function as the argument. If a client with a matching uid is found, the client object is returned.

    Hope it helps
    Participating Frequently
    October 24, 2008
    i have the user id i want to send msg only to that user how i can i send him that msg.do you have any example for private chat which can help me in this meetter. plz help me
    thanks
    TextChat.prototype.sendMessage = function(client, msg){
    if (typeof msg != "string") return;
    if (msg == "") return;
    msg = msg.replace(/(http:\/\/|www\.)\S*\.\S*\b/ig, this.fixURL);
    msg = "<b>[<font color='#6666FF'>" + client.pfcs.user.userName + new Date().getHours()+" : "+new Date().getMinutes()+ " : " + new Date().getSeconds()+ "</font>]:</b> " + msg;
    this.messages_so.send("showMessage", msg);
    this.messages_s.send("showMessage", msg, client.pfcs.user.userName, new Date());
    this.session.addContributor(client.pfcs.user.userName);
    }
    this is the funcution woh sends the messages to all users in the room
    how can i send the msg to a particular user
    thanks
    waiting for ur reply
    October 21, 2008
    Perhaps it's because you're asking for instruction on something complex without explaining where you're having problems. Maybe you'll have better luck getting responses if you post your code and an explanation of where you're stuck.
    Participating Frequently
    October 22, 2008
    if i select a user from a already connected people then how i can chat with that user. simple i cnat get the id of the connected user from the list what kind of server side script i need so that i can connect to that particular user which i selected from the list. now i think so you are in better position to help me. plz reply
    thanks
    Participating Frequently
    October 21, 2008
    no one can answer my question then why is this forum. it is better to close this forum so that man should not waste his time come on man some must know some thing about it so answer it thanks in advance.