I'm very confused again.
All I'm trying to do is add an icon in the userList panel so I created a user variable and retrieved it in the onJoinroom function but only one client gets the update. The second one...
I placed this code in the onJoinRoom function:
Code: Select all
smartfox.onJoinRoom = function(roomObj:Room) {
var userList:Object = roomObj.getUserList();
chat_txt.htmlText = "";
userList_lb.removeAll();
for (var i in userList) {
var user:User = userList[i];
var uName = user.getName();
var uId = user.getId();
if(uName != _global.myName){
var uVars:Object = user.getVariables();
userList_lb.addItem({icon:uVars.gender, data:uId, label:uName});
} else {
userList_lb.addItem({icon:gender, data:uId, label:uName});
}
userList_lb.iconField = "icon";
}
userList_lb.sortItemsBy("label", "ASC");
chat_txt.htmlText += "<font color='#cc0000'>>> Room [ "+roomObj.getName()+" ] joined</font>";
setupMyUser();
}
function setupMyUser() {
smartfox.setUserVariables({gender:gender});
}
Should I do the same in onUserEnterRoom perhaps or include the onUserVariablesUpdate in the code?