UserList not enabled / showing existing users

Everything about the SmartFoxBits UI Components for SmartFoxServer 2X. Post your questions, suggestions and bug reports.

Moderators: Lapo, Bax

mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 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

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!
User avatar
Bax
Site Admin
Posts: 4385
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 23 Nov 2012, 08:56

Having two Connectors is a wrong approach. You need just one, which must be always available (even if hidden).
So make sure you are not destroying the component which contains the Connector.
Paolo Bax
The SmartFoxServer Team
mmancuso
Posts: 19
Joined: 04 Feb 2012, 23:01

Re: UserList not enabled / showing existing users

Postby mmancuso » 23 Nov 2012, 15:44

I thought I was just creating one connector since I removed the sfb:Connector component?
User avatar
Bax
Site Admin
Posts: 4385
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: UserList not enabled / showing existing users

Postby Bax » 25 Nov 2012, 17:29

Sorry, I don't understand your question. Can you rephrase?
Paolo Bax
The SmartFoxServer Team

Return to “SmartFoxBits for SFS 2X”

Who is online

Users browsing this forum: No registered users and 1 guest