Re: UserList not enabled / showing existing users
Posted: 22 Nov 2012, 21:15
Okay it looks like I've solved it (albeit via a bit of a hack). I'll leave it here in hopes that this helps someone else.
I removed the sfb:Connector from my MAIN.mxml component and put manual code at the top of my init() method to manually instantiate the connector
then in another function, after the user logs in, I call
I'm able to refresh the userList when OpenSpace loads, but I was still having the same problem when I was creating my THEATER.mxml component (userList appeared disabled, error appeared if I tried to refresh the userList). I experimented with where in the execution process I placed the refresh code, and the only solution that has worked consistently for me, was to set a 1 second timer to be called when my THEATER.mxml component is created. Every second we try to refresh the userList. If it errors, then we don't stop the timer, if it doesn't, then we stop the timer and the userList has been successfully refreshed.
Not the most ideal way, but it's good enough for now. Hopefully it keeps working. Thanks for your help Bax!
I removed the sfb:Connector from my MAIN.mxml component and put manual code at the top of my init() method to manually instantiate the connector
Code: Select all
connector = new Connector();
smartFox = Connector.smartFox;Code: Select all
connector.connect()Code: Select all
userlistid = setInterval(refreshUserList, 1000);
private function refreshUserList()
{
try
{
this.userListTwo.refreshList();
clearInterval(userlistid);
}
catch (e:TypeError)
{
trace('type error trying to refresh userList...');
}
}