2

I am creating a small chat application using Flash Media Development Server 4.5. I have already created all my user interface components in Flash.

To have a chat application, users need to send messages back and forth to one another. How does Flash player connect to other Flash players? For example, if you have a group of 20 members for example. How do you send a specific message to a client and NOT a group?

Grant Hutchins
  • 4,275
  • 1
  • 27
  • 32

1 Answers1

0

Example of chat application is www.red5chat.com . Free to use. And checck the code flash and Java. Send private message to client code in server is

public void send_private(String fromPseudo, String DestinationID,String msg) {
        //IConnection current = Red5.getConnectionLocal();
        Iterator<IConnection> it = scope.getConnections();
        log.debug("send_private to "+DestinationID+" "+msg);
        //String uid = scope.getClient().getId();
        while (it.hasNext()) {
        IConnection conn = it.next();
        String id=conn.getClient().getId();
        log.debug("id="+id+ " senTO="+DestinationID);
        //if (sendTo.equals(id)) log.info("PAREIL"); else log.info("differents");

        if (!(DestinationID.equals(id))) continue;
        log.info("receive_private "+DestinationID+" "+msg);
            if (conn instanceof IServiceCapableConnection) {
                ((IServiceCapableConnection) conn).invoke("receivePrivateMsg", new Object[]{fromPseudo, msg});
                log.info("received_private "+DestinationID+" "+msg);
            }   
        }
    }
ElitCenk
  • 302
  • 3
  • 10