sendObjectToGroup()

Availability:

Flash Player 6.0
SmartFoxServer Lite / Basic / Pro

Usage:

smartFox.sendObjectToGroup(obj, userList)

Description:

Sends an Actionscript object to one or more users, as specified in the second parameter
Can be useful for sending complex/nested data structures to clients, like a game move or a game status change.

Supported datatypes are: Strings, Booleans, Numbers, Arrays, Objects

Parameters:

obj   An object containing all data that you need to send. The Object can contain other objects, arrays etc...
userList   An array containing one or more recipient id

Returns:

Fires the onObjectReceived event

Example:

A simple object with primitive data is sent to the users with id = 1,2

move = {}
move.x = 150
move.y = 250
move.speed = 8

smartFox.sendObjectToGroup(move, [1,2])

 

See also:

onObjectReceived