--- In flexcoders@yahoogroups.com, "Matt" <[EMAIL PROTECTED]> wrote:
>
> I'm developing a very basic chat application that resembles IRC, but
> I'd like to force the scroll bar to jump to the bottom every time a
> chat entry is added.  This is on a Box and I'm adding Text entries as
> children. I've tried adding a listener for RENDER to push it down, but
> it always pushes it down a few pixels from the bottom instead of the
> absolute bottom. The same happens when I add a listener for CHILD_ADD.
> 
> Can anyone tell me how to get this desired functionality to work in
Flex?
>
Well, I solved this one myself. If anyone is interested I added a
FlexEvent.UPDATE_COMPLETE listener and a CHILD_ADD listener and the
CHILD_ADD listener set a boolean to true and when UPDATE_COMPLETE ran
it checks to see if the boolean is true, if so it sets it to false and
updates the scrollbar position.  This works well to still allow the
client to move the scrollbar to see history but bumps it down every
time a new message is received.

I could get a lot more complicated and have sticky scroll-lock
features, but this is a very basic chat so I don't really care at the
moment. ;)

Hope this helps someone.

Reply via email to