# setTextFormat not working on dynamic text

**URL:** <https://forum.kirupa.com/t/settextformat-not-working-on-dynamic-text/248017>\
**Category:** flash\
**Created:** [January 2, 2008, 9:49pm UTC](https://forum.kirupa.com/t/settextformat-not-working-on-dynamic-text/248017 "2008-01-02T21:49:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [January 2, 2008, 9:49pm UTC](https://forum.kirupa.com/t/settextformat-not-working-on-dynamic-text/248017/1 "2008-01-02T21:49:46Z")

</div>

I have some dynamic text boxes loading text from an array. I initially have the text box aligned “right” but when you put dynamic text it “left” aligns them. Anyway, here is my code:

```auto

var format:TextFormat = new TextFormat();
format.align = "right";
var numLinks:Number = 11;
for (var i = 0; i <= numLinks; i++) {
    this["txt" + i].autoSize = true;
    this["res" + i].txt.autoSize = true;
    this["txt" + i].text = resourceTitles*;
    this["res" + i].txt.htmlText = resources*;
    this["res" + i].txt.setTextFormat(format);
}

```

So my problem is, its not aligning. I even tried doing htmlText and using \<p align=“right”\>resources\*\</p\> and no luck…any ideas?
