2013-05-25 46 views
0
namespace TinyChat 
{ 
    class Program 
    { 
     NetConnection Client; 

     static void Main(string[] args) 
     { 
      Program TinyChat_Function = new Program(); 
      TinyChat_Function.connectTinyChat(); 
     } 
     void connectTinyChat() 
     { 
      Client = new NetConnection(); 
      Client.OnConnect += new ConnectHandler(Client_OnConnect); 
      Client.NetStatus += new NetStatusHandler(Client_NetStatus); 

      Client.Connect("rtmp://209.212.144.77:443/tinyconf", new string[] { "SomeRoom", "none", "show", "tinychat" }); 
     } 
    } 

錯誤:FluorineFx:Client_onConnect不會在目前情況下存在

1 The name 'Client_OnConnect' does not exist in the current context 
2 The name 'Client_netStatus' does not exist in the current context 

使用最新版本FluorineFx的。

該文檔顯示這是正確的方式來做到這一點,但這是行不通的。關於如何解決這個問題的任何想法?

The documentation can be found here.

+0

任何人知道如何解決這個問題? – user1937395

回答

0

哪裏是爲Client_OnConnect事件處理程序代碼和Client_NetStatus事件處理程序?你是加入這裏事件在你的線路上,但你沒有實現的代碼。除非你忘記粘貼在問題中。

Client.OnConnect += new ConnectHandler(Client_OnConnect); 
Client.NetStatus += new NetStatusHandler(Client_NetStatus); 

你,如果你看看這個文件鏈接的代碼

void netConnection_OnConnect(object sender, EventArgs e) 
{ 
    //The NetConnection object is connected now 
    netConnection.Call("serverHelloMsg", new ServerHelloMsgHandler(), "some text"); 
} 

你應該在方法替代netConnection_OnConnectClient_OnConnect和編寫代碼,也許這樣

void Client_OnConnect(object sender, EventArgs e) 
{ 


//handle connection below and do whatever needs to be done 

} 
相關問題