首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Adobe Flash Media Server聊天

Adobe Flash Media Server聊天
EN

Stack Overflow用户
提问于 2012-12-02 01:41:11
回答 1查看 636关注 0票数 2

我正在使用Flash Media Development Server4.5创建一个小型聊天应用程序。我已经在Flash中创建了所有的用户界面组件。

要使用聊天应用程序,用户需要相互之间来回发送消息。Flash player如何连接到其他Flash player?例如,如果您有一个由20个成员组成的组。如何将特定消息发送到客户端而不是群组?

EN

回答 1

Stack Overflow用户

发布于 2013-02-07 15:43:27

聊天应用程序的示例是www.red5chat.com。免费使用。并检查代码flash和Java。向服务器中的客户端代码发送私人消息是

代码语言:javascript
运行
复制
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);
            }   
        }
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13661941

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档