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;
then in another function, after the user logs in, I call
Code: Select all
connector.connect()
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.
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...');
}
}
Not the most ideal way, but it's good enough for now. Hopefully it keeps working. Thanks for your help Bax!