Chat window doesn't always scroll to bottom on new message

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

Moderators: Lapo, Bax

Posts: 19
Joined: 08 Oct 2010, 02:57

Chat window doesn't always scroll to bottom on new message

Postby jonc » 02 May 2011, 21:17


Having a problem with the Chat Box. I recently noticed in our game that sometimes when a new message is added to the chat box that the new line doesn't appear because the box doesn't automatically scroll to the bottom. The line is there and you can manually scroll to see it, but this isn't very satisfactory.

The problem is reproducible if you first fill the chat box with messages and then keep typing new messages from the same user. If another user adds a message, the box seems to scroll correctly, presumably because *two* new lines are being added (the name of the user and the message itself). But if you type a new message yourself, only a single line is added (the user name is omitted) and this doesn't seem to trigger the box to scroll, so the new line is not shown. If you keep typing messages, the box will "catch up" but always lag at least one line behind where it should be.

I was wondering if this was something to do with the way we are using the chat box, so I compiled and ran the Lobby example and it has the same problem.

I used the Flex Bits; we are compiling with Flash Builder 4.0.1.

Anyone else seen this problem or have any solutions?
Posts: 19
Joined: 08 Oct 2010, 02:57

Postby jonc » 02 May 2011, 21:42

Answering my own question... hopefully this will be useful for anyone else running into the same problem.

I added a call to ValidateNow() in the code that sets the chat text box vertical position.

This shouldn't be necessary, since the position is being set on a CallLater() function, but it fixed the problem for me.

I removed the CallLater() since it didn't seem to be making a difference.
User avatar
Site Admin
Posts: 4390
Joined: 29 Mar 2005, 09:50
Location: Italy

Postby Bax » 04 May 2011, 18:51

Thank you for the info.
Paolo Bax
The SmartFoxServer Team

Return to “SmartFoxBits for SFS 2X”

Who is online

Users browsing this forum: No registered users and 1 guest