actionscript 3 - show last 100 lines textArea AS3 Flash -
I have a very busy chat app and Textaria is ready to clean itself after a certain text, but What do I want to show the last 100 lines of text in Textaria and remove the rest.
The use of Flash CC The text comes from the Red5 server like this: So, the last 100 lines have any idea to keep the chat? Thanks!: -) I store all the messages I receive in just one message: And drew past 0-100 objects for performance Press: < Rescue message (user name: string, message: string) on code> function: zero {if (myTextArea.length> 21400) {myTextArea.htmlText = ""; } // To add text to text. MyTextArea.htmlText + = "& font color = '# ff0000' & gt; + + User Name +": "+ Message" & lt; / Font & gt; ";}
different messages: array = []; Username: string, msg: string): zero {messages.push ({username: username, msg: msg}) displayMessages (); // look lower.}
function display message (): zero {myTextArea.htmlText = ""; recently: array = message. Slices (-100); for each (var i: object hall Only) {myTextArea.htmlText + = "& lt; Font color = '# FF0000' & gt; + IuserName + ":" + i.msg + "& lt; / font & gt;"; }}
Comments
Post a Comment