I might have found a solution to this!
I created 3 event listeners for users entering, leaving, and being kicked out of a room:
_userManager.addEventListener(UserEvent.USER_CREATE, onUserCreate);
_userManager.addEventListener(UserEvent.USER_REMOVE, onUserRemove);
_userManager.addEventListener(UserEvent.USER_BOOTED, onUserBooted);
I then added the 3 handlers for the events:
privatefunction onUserCreate(p_evt:UserEvent):void{
updateRosterList();
}private function onUserRemove(p_evt:UserEvent):void{
updateRosterList();
}
private function onUserBooted(p_evt:UserEvent):void{
updateRosterList();
}
Then, I created the functio which updates the "acceptedList":
protected function updateRosterList():void
{
var rosterListArray:ArrayList = new ArrayList();
for(var i:int=0; i<cSession.userManager.userCollection.length; i++)
{
var uDesc:UserDescriptor=_userManager.userCollection[i];
if (uDesc.userID != _userManager.myUserID)
{
rosterListArray.addItem({label:uDesc.displayName, descriptor:uDesc});
}}
rosterList.dataProvider = rosterListArray;
}
I don't know if this is the most elegant solution, but it does work!
Any feedback would be greatly appreciated!
Matt