Text boxes, arrays, and loops

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:

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:

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 :slight_smile: