# appendText Syntax Problem

**URL:** <https://forum.kirupa.com/t/appendtext-syntax-problem/233858>\
**Category:** Uncategorized\
**Created:** [July 27, 2007, 3:12pm UTC](https://forum.kirupa.com/t/appendtext-syntax-problem/233858 "2007-07-27T15:12:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceflyin](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iceflyin](https://forum.kirupa.com/u/iceflyin)\
**Post date:** [July 27, 2007, 3:12pm UTC](https://forum.kirupa.com/t/appendtext-syntax-problem/233858/1 "2007-07-27T15:12:08Z")

</div>

I can’t figure out the AS3 syntax for appending text to a changing textfield variable name.

```auto

function onResult(result:Object):void {
    var titleArray = result.feedTitles.split(",");
    var urlArray = result.feedURLs.split(",");
    //Display Titles and Urls.
        for (var i=0; i<=titleArray.length-1; i++) {
        var titleVar = 'Title'+i;
        var urlVar = 'URL'+i;
        trace(titleArray*); // Trace runs perfect...

//This does nothing...
       this[titleVar].appendText(titleArray*);
        this[urlVar].appendText(urlArray*);
    }
}

//These work for a single variable, but I need my LOOP!
this.Title0.text=titleArray[0];
this.Title0.appendText(titleArray[0]);

```

Edit: Never mind… I just went back to my old code… I would still like to know how to use appendText in this way, though…

```auto

    for (var i=0; i<=titleArray.length-1; i++) {
        var titleVar = 'Title'+i;
        var urlVar = 'URL'+i;
        trace(titleArray*);
        this[titleVar].text=titleArray*;
        this[urlVar].text=urlArray*;
    }
    }

```
