I have a problem attaching uservariables to my users - right now I am working on a "1 on 1" chat, where 2 people can chat with eachother and use webcam.
I would use the uservaribles for each user, to contain their profile name, information about webcam (is it ON / OFF)
So I use this for setting my userVariables - I am setting these variables in the "onJoinRoom" event, as that is when I have entered my destination room :
Code: Select all
vars = new Object()
vars.screenname = screenname;
vars.webcam = false;
smartFox.setUserVariables(vars);
I get no error from SmartFoxServer, so I assume everything went fine when setting the variables.
Later on, in the "onUserEnterRoom" event, I want to display information about the users who enters the room (my opponent chatter in this case), so I access his users variables like this :
Code: Select all
screenname = userObj.getVariable("screenname");
But it only returns "undefined" - and I cannot seem to see what I am doing wrong ...
Can anyone help me ?
-
Regards from Copenhagen,
Tony Fonager