4 Replies Latest reply on Feb 15, 2007 12:59 AM by nicetim

    HTMLtext does not reflect tect color or size

    leotemp Level 1
      Ive tried using both the Text and Label componnents to display Richtext but I havent got it to work, I have tried using both the "Text" and "Htmltext" properites and still no visual difference in the text. I am using an RichTextEditor to make changes ot the rich text befor updating it to a db which is the source for it to be displayed, whats really odd is if make a hyperlink in the rtf editor and update it, the text becomes clickable(shows hand on mouseover link a link) but none of the color or font changes i have made are reflected, ive been trying to get an answer to this for sometime..
        • 1. Re: HTMLtext does not reflect tect color or size
          ntsiii Level 3
          I have not used the RichTextEditor at all, but i do know that Flex can only display a VERY limited set of html tags. <a> is one of them.

          You will not be able to get full rich text to display in flex.

          Tracy
          • 2. Re: HTMLtext does not reflect tect color or size
            jtan
            Here is some code where a RichTextEditor changes the styles on a Text Component.

            <?xml version="1.0"?>
            <!-- complexDGEditorReturnObject.mxml -->
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" width="700" >
            <mx:Script>
            <![CDATA[
            import mx.collections.ArrayCollection;

            [Bindable]
            public var initDG:String = '<b>Roses</b>';

            private function updateText():void
            {
            myText.htmlText = rie.htmlText;
            }
            ]]>
            </mx:Script>

            <mx:Text id="myText" htmlText="{initDG}" width="100%" height="100%"/>
            <mx:RichTextEditor id="rie" htmlText="{myText.htmlText}" change="updateText()" />

            </mx:Application>
            • 3. Re: HTMLtext does not reflect tect color or size
              leotemp Level 1
              well whats odd is if i use html to create colored letters and change fonts they work just fine but in order to do that i have to strip out all of the '<' and '>' and then put them back again when i reteive them later out of the db, i guess that is what i will have to do and then build a htmledit component similar to the rtfeditor
              • 4. Re: HTMLtext does not reflect tect color or size
                nicetim Level 1
                The issue i found with it is when the rt saves, the font tag has the size property set to the value you choose in the font size drop down. the issue is the HTML does not recognize any number here higher than a 6, the lowest the editer will allow you to choose is an 8.

                This component should be updated!
                instead of using the font "size=N" attribute it should use a "style='font-size:N"
                that way the content of the HTMLText property when saved back to a source, can then be viewed in a standard html page.