# Text boxes, arrays, and loops

**URL:** <https://forum.kirupa.com/t/text-boxes-arrays-and-loops/139255>\
**Category:** Uncategorized\
**Created:** [March 1, 2005, 6:05pm UTC](https://forum.kirupa.com/t/text-boxes-arrays-and-loops/139255 "2005-03-01T18:05:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![StratusGD](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@StratusGD](https://forum.kirupa.com/u/StratusGD)\
**Post date:** [March 1, 2005, 6:05pm UTC](https://forum.kirupa.com/t/text-boxes-arrays-and-loops/139255/1 "2005-03-01T18:05:28Z")

</div>

I’m sure this question has been asked before, but I really can’t find an old post or tutorial that answers it (probably searching the wrong topic, but to the point):

Without going too much into project details, it’s just a very basic interactive CD. Overview, 9-10 categories of PDFs (the name & location of each are stored in one of 9-10 XML files, 1 per category), and a bibliography.

I have an array of a custom class called AML\_pdf (each item has the properties ‘title’ and ‘url’. I have a set of text boxes I need to list the titles in.

I can do:

```auto
title0.text = AML_pdf[0].title;
title1.text = AML_pdf[1].title;
title2.text = AML_pdf[2].title;

```

…but that is awkard at best, prone to error, and a pain if the # of PDFs on the CD changes.

What I’d like to do is something like:

```auto
for(i=0; i<10; i++) {
["title"+i].text = AML_pdf*.title;
}

```

But I can’t figure out the correct syntax for the left side of the equation - I keep getting an error.

Can anyone help? Thanks 🙂
