Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Solve formatting in a TextArea

Posted on 2010-09-06
3
Medium Priority
?
867 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:Cesar Aracena
3 Comments
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 400 total points
ID: 33616074
0
 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 600 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:Cesar Aracena
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

972 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