" To create a multiline, noneditable text field, use the Text control "
http://livedocs.macromedia.com/labs/1/flex/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000481.html
 
Btw, the example in the Flex 2 doc doesn't work, it looks that everything after a new line is trimmed:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" backgroundColor="#FFFFFF">

<!-- Simple example to demonstrate the Label control -->
<!-- For Flex 2.0, must replace newline with "\n" -->
<mx:Script>
   <![CDATA[
     
      private var htmlData:String = "<br>Label's htmlText property contains HTML-formatted text." + "\n" +
                    " If your text string contains" + "\n" +
                    " HTML tags, you must wrap it in the CDATA tag." + "\n" +
                    " The control  collapses any white space characters, such as tab" + "\n" +
                    " and  newline characters. For the special characters left  angle bracket (&lt;), " + "\n" +
                    " right angle bracket (&gt;),  or ampersand (&amp;), " + "\n" +
                    " insert the HTML equivalents of  <CODE>&amp;lt;</CODE>, <CODE>&amp;gt;" + "\n" +
                    " </CODE>, and <CODE>&amp;amp;</CODE>.  <br> "+ "\n" +
                    " <p><b>Note</b>:The <CODE>htmlText</CODE> property ignore CSS style settings for the control, " + "\n" +
                    " and instead rely on the HTML tags in the string for formatting." + "\n" +
                    " </p>  ";
                                        
          private function displayDetails()
          {
             simpleLabel.text="";
             simpleLabel.htmlText= htmlData;
          }
         
          private function clearArea()
          {
             simpleLabel.text="This Label displays Html Text";
          }     
  
   ]]>
</mx:Script>

  <mx:Panel title="Label Panel" width="640" height="250">
   
        <mx:Label id="simpleLabel" text="This Label displays Html Text"/>
        <mx:Button id="Display" label="Click to diplay Label's Html Text" click="displayDetails();"/>
        <mx:Button id="Clear" label="Clear htmlText" click="clearArea();"/>
 
  </mx:Panel>

</mx:Application>
 
 
Philippe Maegerman


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Philippe Maegerman
Sent: mardi 8 novembre 2005 17:29
To: [email protected]
Subject: RE: [flexcoders] How to display label 's text on multiple line if it contain one big line

You should use 'htmlText' instead of 'text'

<mx:Label
htmlText="&lt;b&gt;Hello&lt;/b&gt; &lt;br&gt;World"/>
<mx:Text htmlText="&lt;b&gt;Hello&lt;/b&gt; &lt;br&gt;World" />
 
However, when trying this code with Flex 2, only the Text component was adding a line break, not the Label, is this a bug?
You can see that the <b></b> tag is taken in account but not <br>
 
Philippe Maegerman


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of sandip_patil01
Sent: mardi 8 novembre 2005 11:29
To: [email protected]
Subject: [flexcoders] How to display label 's text on multiple line if it contain one big line

Hi All,

I want to display Label's text on multiple line.

Here is my Scenorio,

<mx:Label text="Lorem ipsum dolor sit amet, consectetuer   
adipiscing elit. Cras tincidunt cursus libero.Nam in nunc ac felis
ullamcorper feugiat.:"/>

I want to display this label in output as,

Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Cras tincidunt cursus libero.
Nam in nunc ac felis ullamcorper feugiat.

Can anybody help me out.

Thx in advance,
Sandip patil



------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to