Solved

Solve formatting in a TextArea

Posted on 2010-09-06
3
835 Views
Last Modified: 2013-11-11
Hi all,

I'm new to AS. I'm trying to make my own apps on Flash Builder 4 using some examples but most of them are from Flex 3. I'm trying to interact with Wowza Media Server.

In a simple text chat application I have a returning string that's printed into a TextArea but the HTML tags are not bing parsed. Here's the message passed to the TextArea:
msg = "<u>"+hourStr+":"+minuteStr+":"+secondStr+ampm+"</u> - <b>"+chatData.user+"</b>: "+chatData.message;
				return msg;

Open in new window

and here's the result every time I insert a msg:
<p><u>10:04:38AM</u> - <b>My Name</b>: This is a sample message sent to the chat</p>

Open in new window


It also doesn't recognize the line breaks. All the msgs appear one after another.

This is my actual TextArea for displaying messages:
<s:TextArea content="{chatText}" id="listChat" width="500" height="200" enabled="{isConnected}"/>

Open in new window

I've tried content="" and also text="" with the same result.

Any ideas?

Thanks in advance!
0
Comment
Question by:Caracena
3 Comments
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 100 total points
Comment Utility
0
 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 150 total points
Comment Utility
HTML text handling in spark components are very different, and you'll need to create spark compatible HTML text, see an example at http://polygeek.com/2249_flex_display-html-text-in-the-spark-textarea

Or simply you can use MX text area control as shown below, it should work with your current HTML text too.
E.G:
<mx:TextArea htmlText="{chatText}" id="listChat" width="500" height="200" enabled="{isConnected}"/>
0
 
LVL 6

Author Closing Comment

by:Caracena
Comment Utility
Thanks to both of you. I was looking for a way to do htmlText in the spark component (thanks for the link to textFlow) but it seems that using the mx component is still safer and more accurate.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now