# Scrolling Chat Box

**URL:** https://forum.kirupa.com/t/scrolling-chat-box/213162
**Category:** flash
**Created:** [January 17, 2007, 11:31am UTC](https://forum.kirupa.com/t/scrolling-chat-box/213162 "2007-01-17T11:31:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shard](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Shard](https://forum.kirupa.com/u/Shard)
#### Post date: [January 17, 2007, 11:31am UTC](https://forum.kirupa.com/t/scrolling-chat-box/213162/1 "2007-01-17T11:31:49Z")

</div>

Ok -I’ve got a chat box (htmlText field) complete with scrollbar etc and it gets populated by php every time a user enters text. What I want is to have it trim the 1st entry off once the last entry reaches a certain number (to keep the box from being extremely high after about 5 mins with 20 users). At the moment the box auto scrolls to the bottom each time a new entry comes in with … chat\_txt.scroll = chat\_txt.maxscroll;… and that keeps the users happy since they don’t need to scroll anything. I just assume that having a text field with over 8000 lines of text has got to be consuming resources somewhere? lol  
Any help greatly appreciated - ideally i’d like to have the equivalent of two screens worth of text before it starts throwing old lines out from the top.  
P.S The field has a style sheet associated with it so I cant use settextformat properties - just to make it difficult - lol
