# Numbered List in a text field

**URL:** <https://forum.kirupa.com/t/numbered-list-in-a-text-field/181265>\
**Category:** flash\
**Created:** [March 7, 2006, 10:23pm UTC](https://forum.kirupa.com/t/numbered-list-in-a-text-field/181265 "2006-03-07T22:23:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ORNj](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@ORNj](https://forum.kirupa.com/u/ORNj)\
**Post date:** [March 7, 2006, 10:23pm UTC](https://forum.kirupa.com/t/numbered-list-in-a-text-field/181265/1 "2006-03-07T22:23:55Z")

</div>

I’m trying to create the appearence of a numbered list in Flash as to the best of my knowledge you can’t easily create one using list tags in an HTML text box. I need to accomplish this in a way which will allow it to be easy for the list to be changed according to the contents of a database.

After a little bit of poking around I have come up with some simple code:

```auto

var bodyStyleSheet:Object = new TextField.StyleSheet();
bodyStyleSheet.setStyle("a:link", {color:'#FF9900'});
bodyStyleSheet.setStyle("a:hover", {color:'#FDD658'});
bodyStyleSheet.setStyle(".number", {color:'#FF9900'});
//	---
this.text_mc.field.html = true;
this.text_mc.field.styleSheet = bodyStyleSheet;
this.text_mc.field.htmlText = "<textformat indent='20'><span class='number'>1.</span></textFormat>";
this.text_mc.field.htmlText += "<textformat blockIndent='54'> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio. Duis fringilla commodo felis. Nunc id ligula vel mi interdum pulvinar. Proin scelerisque erat euismod nunc.</textformat><br><br>";
this.text_mc.field.htmlText += "<textformat indent='20'><span class='number'>10.</span></textFormat>";
this.text_mc.field.htmlText += "<textformat blockIndent='54'> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed odio. Duis fringilla commodo felis. Nunc id ligula vel mi interdum pulvinar. Proin scelerisque erat euismod nunc.</textformat>";

```

Now when the movieclip containing the text field is located at X=10, I achieve the effect that I want with the above code:

![](http://www.pages.drexel.edu/~sbh26/img1.gif)

Fantastic, however when I move the movieclip containing the textfield to X=50, the text becomes misaligned:

![](http://www.pages.drexel.edu/~sbh26/img2.gif)

I tried changing the tabStops but that didn’t seem to have any effect on the text what so ever. I am thinking that the tabstops are measured from the origin of the root movieclip but I can’t find any documentation to either confirm or disprove my theory.

Can any one shed some light on this for me?
