Question
Convert Shared Object properties into ordered array
I need to put the shared object data (that contains the
client names) into an ordered array.
The following is NOT useful:
for (var i in _chatSO.data) {
if (_chatSO.data != null) {
var clientObj = _chatSO.data;
users.push(clientObj.username);
}
}
That doesn't solve my problem because each client will end up with an array of different order, e.g., [client1, client2, client3] and [client2, client1, client3] etc.
Context: Multiplayer game where I make 2 teams and assign a number and colour (color) to each player. Each client (player) that joins needs to create movie clips representing the previously joined players, each labeled with a number. Unless they have access to the same array, it can't be done.
Thank you,
Norm (new to FMS)
The following is NOT useful:
for (var i in _chatSO.data) {
if (_chatSO.data != null) {
var clientObj = _chatSO.data;
users.push(clientObj.username);
}
}
That doesn't solve my problem because each client will end up with an array of different order, e.g., [client1, client2, client3] and [client2, client1, client3] etc.
Context: Multiplayer game where I make 2 teams and assign a number and colour (color) to each player. Each client (player) that joins needs to create movie clips representing the previously joined players, each labeled with a number. Unless they have access to the same array, it can't be done.
Thank you,
Norm (new to FMS)
