Previous "FluorineFX + Flex Video chat room case development----Server Side" detailed how to use FluorineFX to develop a timely communication of the video chat Room server processing program, and through the Web site to host the operation of the service handler. This article will focus on client-side development of video chat rooms, including connecting rtmp servers, releasing video, receiving video, online user list, sending text messages, and all-server small speaker function points.
These function points in my previous writing has appeared in the article n many times, so here I do not want to explain to them too much, please refer to the flex and. NET Interoperability series, here I put the core of a few method code to post a simple description. The first is the customer to achieve user login, through the FluorineFX provided by the Remotingservice interface method for data validation.
Private Function Onlogin (event:mouseevent): void {remoteconn = new Remotingconnection ("Http://localhost:2020/ChatRo Om.
Fluorinefxweb/gateway.aspx ", OBJECTENCODING.AMF3);
MyInfo = new UserInfo ();
Myinfo.username=this.txtusername.text;
Myinfo.password=this.txtpassword.text;
Remoteconn.remotingcall ("ChatRoom.Services.DataService.Login", onloginresult,onloginfault,myinfo);
Private Function Onloginresult (result:userinfo): void {if (result!= null) {This.myinfo = result;
This.viewStack.selectedChild = Chatview;
RTMPNC = new Rtmpconnection ("Rtmp://localhost:2777/videochat", objectencoding.amf3,onnetstatushandler,myinfo); else {This.lbState.text = "Login failed, username or password error!"
"; } Private Function Onloginfault (event:object): void {This.lbState.text = "Login failed, please try again!"
";
}
Private Function OnClear (event:mouseevent): void {this.txtusername.text= "";
This.txtpassword.text= "";
This.lbstate.text= ""; This.txtuSername.setfocus (); }