# Text.htmlText

**URL:** <https://forum.kirupa.com/t/text-htmltext/260797>\
**Category:** Uncategorized\
**Created:** [May 19, 2008, 11:47pm UTC](https://forum.kirupa.com/t/text-htmltext/260797 "2008-05-19T23:47:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adnan794](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@adnan794](https://forum.kirupa.com/u/adnan794)\
**Post date:** [May 19, 2008, 11:47pm UTC](https://forum.kirupa.com/t/text-htmltext/260797/1 "2008-05-19T23:47:07Z")

</div>

hi

I am using a static textfield that is used to diplay the html formatted text for different links.

I am using an xml file that contains the contents in an html formatted tags.

I have an objective link that has the following value \<li\>bullet point 1\</li\>\<li\>Bullet point2\</li\>

If the user clicks objective link then the text is diplayed in bulleted form in AS3 textfield

when the user clicks other text field link contact us then the contact us text is also displayed with bullet points.

Can anyone tell why the bullets are still appearing?

---

<div class="post-metadata">

**Author:** ![wvxvw](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wvxvw](https://forum.kirupa.com/u/wvxvw)\
**Post date:** [May 20, 2008, 12:26am UTC](https://forum.kirupa.com/t/text-htmltext/260797/2 "2008-05-20T00:26:38Z")

</div>

It’s difficult to tell unless you show the code…  
But you may check this one out, it’s an example of using htmlText links with AS functions:

```auto
var text_xml:XML = <xml>
<![CDATA[
   <li><a href='event:1'>entry 1</a></li>
   <li><a href='event:2'>entry 2</a></li>
   <li><a href='event:3'>entry 3</a></li>
   <li><a href='event:4'>entry 4</a></li>
   ]]>
</xml>;
var tf:TextField = new TextField();
tf.border = true;
tf.width = 200;
tf.height = 200;
tf.multiline = true;
tf.wordWrap = true;
addChild(tf);
tf.addEventListener(TextEvent.LINK, handleLinkPress);
function resetText(i:int=0):void {
 var r_str:String = String(text_xml.text()).replace(/[\r|
|	]/g, '');
 switch(i){
  case 0:
  default:
   break;
  case 1:
   r_str = r_str.replace(/<li>.{15}1.{1,}?<\/li>/g, '<li>entry 1 clicked</li>');
   break;
  case 2:
   r_str = r_str.replace(/<li>.{15}2.{1,}?<\/li>/g, '<li>entry 2 clicked</li>');
   break;
  case 3:
   r_str = r_str.replace(/<li>.{15}3.{1,}?<\/li>/g, '<li>entry 3 clicked</li>');
   break;
  case 4:
   r_str = r_str.replace(/<li>.{15}4.{1,}?<\/li>/g, '<li>entry 4 clicked</li>');
   break;
 }
 tf.htmlText = r_str;
}
function handleLinkPress(evt:TextEvent):void {
 resetText(int(evt.text));
}
resetText();

```

---

<div class="post-metadata">

**Author:** ![adnan794](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@adnan794](https://forum.kirupa.com/u/adnan794)\
**Post date:** [May 20, 2008, 1:05am UTC](https://forum.kirupa.com/t/text-htmltext/260797/3 "2008-05-20T01:05:23Z")

</div>

hello wvxwvw:)

Thanks for your time and you are rite it is difficult to tell without looking at the code. But I figured out the problem it was just I was not closing one of \<li\> tags properly so thats why it was giving strange results no wonder.

Thanks for your time appreciate that.

Do you know any good software that represents the AS3 classed of ur project in the form of UML diagram?

---

<div class="post-metadata">

**Author:** ![wvxvw](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wvxvw](https://forum.kirupa.com/u/wvxvw)\
**Post date:** [May 20, 2008, 8:24am UTC](https://forum.kirupa.com/t/text-htmltext/260797/4 "2008-05-20T08:24:38Z")

</div>

Glad it’s solved =)  
I actually don’t use UML utilities much (I use FD and the way it displays classes and packages seem to be enough for me), the only utility I tried for this purpose was FreeMind. No complains though, it worked fine =)  
[http://freemind.sourceforge.net/wiki/index.php/Main\_Page](http://freemind.sourceforge.net/wiki/index.php/Main_Page) (it’s free to download and use, distributed under GPL) Mind it, you need the latest beta, not a release version

---

<div class="post-metadata">

**Author:** ![adnan794](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@adnan794](https://forum.kirupa.com/u/adnan794)\
**Post date:** [May 20, 2008, 7:12pm UTC](https://forum.kirupa.com/t/text-htmltext/260797/5 "2008-05-20T19:12:35Z")

</div>

Thanks I will give it a try.
