?? main.asc
字號:
userList=[];
application.onAppStart=function()
{
trace("fms服務器啟動......");
}
application.onConnect = function(currentClient)
{
application.acceptConnection(currentClient);
if (userList.length>=3)
{
currentClient.call("showServerMsg",null,"已經(jīng)達到最大用戶數(shù)");
application.rejectConnection(currentClient);
}
else
{
currentClient.communicateServer= function(value)
{
currentClient.username=value;
trace(currentClient.username+"加入聊天室");
userList.push(value);
trace("當前用戶列表"+userList);
application.broadcastMsg("playOtherVideo",userList);
}
}
}
application.onDisconnect=function(currentClient)
{
trace("用戶"+currentClient.username+"離開聊天室");
for(j=0;j<userList.length;j++)
{
if ( userList[j]==currentClient.username )
{
userList.splice(j,1);
}
}
trace("當前用戶列表"+userList);
application.broadcastMsg("playOtherVideo",userList);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -