Solved

Solve formatting in a TextArea

Posted on 2010-09-06
3
839 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

864 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

22 Experts available now in Live!

Get 1:1 Help Now