setUserVariables()
Availability:
Flash Player 7, 8
SmartFoxServer Lite / Basic / Pro
Usage:
smartFox.setUserVariables(varObj:Object, roomId:Number)
Description:
Stores data on the server side. When you set/update/delete one or more User Variables all the other users in the room will be notified. User variables are usefull to store user profile data that can be shared across other users.
Parameters:
varObj | an object containing the variables to save | |
roomId | (optional) the id of the source room, if you are allowing users to join multiple rooms |
Returns:
Fires the onUserVariablesUpdate event
Example:
Example #1
in an avatar chat you could save the user profile (avatar name and position)
like this:
var uVars:Object = new Object() uVars.myAvatar = "Homer" uVars.posx = 100 uVars.posy = 200 smartFox.setUserVariables(uVars)
See also:
onUserVariablesUpdate