Home > Components, Flex > Label HtmlText in Flex

Label HtmlText in Flex

While working on some stuffs with related to htmltext using some styles for Label, it seems to be not displaying the text.

Here were the some sample scripts denoting the error which i encountered

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221;
initialize=”init()”
layout=”vertical”>
<mx:Label>
<mx:htmlText>
<![CDATA[
Label text goes here
]]>
</mx:htmlText>
</mx:Label>

</mx:Application>

It might seems to be fine with the above code, but it wont display the text, since the text entered in the CDATA section is on the second line. While working on stuffs with various html tags inside the same line, it might be very hard to figure out this silly mistakes sometimes.

The working version of the above staments would need to be like this

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml&#8221;
initialize=”init()”
layout=”vertical”>
<mx:Label>
<mx:htmlText>
<![CDATA[Label text goes here]]>
</mx:htmlText>
</mx:Label>

</mx:Application>

I guess it should be a IDE enhancement stuff when using htmlText inside Label, the cursor should default to be on the first line of the CDATA section of the Label control.(The Label control is a noneditable single-line text label)

Advertisements
Categories: Components, Flex
  1. February 1, 2010 at 22:51

    There’s good info here. I did a search on the topic and found most people will agree with your blog. Keep up the good work mate!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: