Flex Chat:TextArea htmlText 的替代方案

发布于 2024-10-09 03:21:31 字数 461 浏览 0 评论 0原文

我正在使用 Flex 构建一个聊天室。尽管我的 Flex 应用程序包含更多内容(如用户列表、其他按钮),但大多数应用程序都基于文本区域、文本输入和按钮(标记为“发送”)。当用户在文本输入中写入内容并按“发送”按钮(或 Enter)时,他会向房间中的所有其他用户发送一条消息。 TextArea 是所有消息所在的地方...

现在,我的问题是,当 TextArea 开始变大(其中有很多文本)时,应用程序开始响应缓慢。我使用 TextArea 的 .htmlText 属性来设置文本,因为我希望提及用户昵称的行在 TextArea 中突出显示。我可以做什么来解决这个问题?我是否可以以某种方式扩展 TextArea 以使其更具响应性(因为我不需要 htmlText 的所有功能,我只需要将部分文本加粗或采用不同的颜色),或者是我修剪部分文本的唯一选择TextArea 文本(例如,如果它的长度超过 10000 个字符,请删除其中的前半部分)...是否有比 TextArea 更好的组件用于此目的?

I'm building a chat room with Flex. Although my flex application contains a lot more (like users list, other buttons), most of the application is based on a text area, a textinput and a button (labeled Send). When a users writes something in the textinput and presses the Send button (or Enter), he sends a message to all other users in the room. The TextArea is the place where all messages go...

Now, my problem is that when the TextArea starts getting big (there is a lot of text in it), the application is starting to respond slowly. I'm using the .htmlText property of the TextArea to set the text because I want the lines where the users nickname is mentioned to get highlighted in the TextArea. What can I do to fix this? Can I somehow extend the TextArea to make it more responsive (because I don't need all the functionality of htmlText, I just need to make part of the text bold, or in different color), or is my only option to trim part of the TextArea text (for example, If it's length get's over 10000 charaters, remove the first half of them)... Is there a better component than TextArea for this purpose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂人 2024-10-16 03:21:31

您需要将聊天文本保留多长时间?为什么不直接删除最旧的行呢?

这似乎是一个已知问题。关于这个主题似乎还有一些较老的问题。例如 粘贴TextArea 中的大量文本会导致脚本执行超时

在 Adob​​e 论坛上还发现了这一点:文本量变大后,TextArea 变得非常慢

并且: 使用 TextArea 性能不佳

For how long do you need to keep the text in the chat? Why not just remove the oldest lines?

This seems to be a known problem. And there seem to be older questions on the subject. e.g. Pasting a large amount of text in a TextArea leads to a script execution timeout

Also found this on Adobe's forums: TextArea gets very slow after text amounth gets larger

And: Poor performance using TextArea

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文