Solved

Solve formatting in a TextArea

Posted on 2010-09-06
3
853 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 495
private function works only without TabNavigator? 3 343
Removing Flash from Website 6 78
IE11 stops playing video on a certain website 10 110
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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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.
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.
Suggested Courses

710 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