I want to do this:
private function getUserName(sUserID:String):String
{
?
}
I do this:
collectionNode = new CollectionNode();
collectionNode.sharedID = "dataObject";
collectionNode.connectSession = _cSession;
collectionNode.subscribe();
collectionNode.addEventListener(CollectionNodeEvent.ITEM_RECEIVE, onItemReceive);
...
and need the UserName in onItemReceive
henry
Views
Replies
Total Likes
Hi Henry,
Not sure I understand what you're getting at here. Generally,
_cSession.userManager.getUserDescriptor(sUserID).displayName will give you
what you want, provided the session is synched up.
hope that helps,
nigel
Views
Replies
Total Likes
OK
private function getUserName(sUserID:String):String
{
if (_cSession.isSynchronized) {
return _cSession.userManager.getUserDescriptor(sUserID).displayName;
} else {
return "";
}
}
Or can force to sync? I would hate to return "".
Or is the CollectionNodeEvent.ITEM_RECEIVE event proc always called in synchronized state?
Henry
Views
Replies
Total Likes
Hi,
Assuming your user is connected and in the room, the session's in sync, so
you're right, you'll always be in sync during ITEM_RECEIVE.
nigel
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies