Combining/converting Variables

I am having a bit of trouble combining variables.

I have a dynamic text field that I am using to show which picture is displayed. When you click on a “next picture” button, I increase the variable piccount with one. picCap stays the same as it represents the total number of pictures in that section. (see code)
My dynamic text field is called piccount.
I am loading the names of the corresponding pictures with loadvars into a variable called loadText. My text file looks like this:

&pic1=Building 1
&pic2=Building 2
&pic3=Building 3

The variables in the text file are being loaded properly as the following code displays the following in my textfield: 1/3 Building 1

[AS]_root.piccount.text = (picnumber+" / “+picCap+” "+loadText.pic1);[/AS]

However I can’t seem to get the correct info for the correct picture as the above code obviously displays “building 1” for each picture. I have tried a bunch of different options like combining the variables but can’t get it quite right.

Can someone help me display the correct text for each picture?

I’d use
_root.piccount.text = (picnumber + “/” + picCap + " " + loadText[“pic” + picCap]);

Hope this helps some.

Thanks, Ill give it a try tonight! :slight_smile: