Solved

Solve formatting in a TextArea

Posted on 2010-09-06
3
841 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
ID: 33616074
0
 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 150 total points
ID: 33616090
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
ID: 33617386
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

777 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