onRoomVariablesUpdate()

Availability:

Flash Player 6.0
SmartFoxServer Basic / Pro

Usage:

smartFox.onRoomVariablesUpdate(roomObj, changedVars)

Description:

The event is fired when room variables are updated in a certain room. A client receives these notifications only from the room(s) where he's currently logged in.
To optimize bandwidth only the variables that changed are transmitted.

Parameters:

roomObj   The object of the room in which variables were updated
changedVars   An associative array with the names of the changed variables as keys

Check the Room Class for more info on the objects returned.

Returns:

nothing

Example:

smartFox.onRoomVariablesUpdate = function(roomObj, changedVars)
{
	// We're interested in seeing if the variable called "score" was changed
	if (changedVars["score"])
	{
		var variables = roomObj.getVariables()
		trace("Current score: " + variables["score"])
	}
}

See also: