HTML support in TextField is known to have issues.  I wouldn' t do
anything unexpected like having an <li> without enclosing <ul> or <ol>.

 

-Alex

 

For another angle, see:
http://blogs.adobe.com/aharui/2008/01/html_and_flex_1.html

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of chrycheng
Sent: Sunday, January 06, 2008 8:11 PM
To: [email protected]
Subject: [flexcoders] Re: Problem with LI Tags in HTML Text

 

Not yet. Traced all the way to mx.core.UITextField with no
conclusions. Probably need to trace further up the class heirarchy
tree but flash.text.TextField isn't available.

Experimented some more. Found out that:

1. Cannot work around the problem by first clearing htmlText (i.e.,
"htmlText = null").

2. Only the text is changed after the switch. (i.e., comparing
htmlText before and after the switch shows that the same tags and
attributes are wrapped around the text).

Perhaps someone from the Flex team here can help? :P

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Stephen Roy J. Tang"
<[EMAIL PROTECTED]> wrote:
>
> Hmm...I encountered something similar a while back but couldn't solve
> it. Have you solved this yet? 
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Christian Cheng" <chrycheng@>
> wrote:
> >
> > Hi guys,
> > 
> > Consider the ff. code:
> > 
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
> layout="absolute">
> > <mx:Script>
> > <![CDATA[
> > [Bindable]
> > private var htmlText:String = "<li>A list item.</li>";
> > ]]>
> > </mx:Script>
> > <mx:Canvas x="10" y="10" width="584" height="200"
> backgroundColor="#ffffff">
> > <mx:Text x="10" y="10" width="564" height="85"
> htmlText="{htmlText}"/>
> > <mx:Text x="10" y="105" width="564" height="85"
> > htmlText="&lt;li&gt;Another list item.&lt;/li&gt;" id="t"/>
> > </mx:Canvas>
> > <mx:Button x="10" y="218" label="Button" click="htmlText='&lt;p&gt;A
> > paragraph.&lt;/p&gt;'; t.htmlText='&lt;p&gt;Another
> > paragraph.&lt;/p&gt;'"/>
> > </mx:Application>
> > 
> > Click on either list item displayed before clicking on the button.
> > Notice that the Text instance you clicked retains the bullet point
> > after its htmlText property has been changed.
> > 
> > Searched for "li", "htmltext", "click", and/or "list item" in Yahoo!
> > Tech and in the Adobe Bug System but couldn't find any helpful posts
> > or reports. Anyone encountered (and hopefully solved this problem)
> > before?
> > 
> > Attached are the MXML and SWF files for your convenience.
> > 
> > Thanks,
> > Chry
> >
>

 

Reply via email to