# Combining/converting Variables

**URL:** https://forum.kirupa.com/t/combining-converting-variables/118484
**Category:** Uncategorized
**Created:** [August 5, 2004, 9:23pm UTC](https://forum.kirupa.com/t/combining-converting-variables/118484 "2004-08-05T21:23:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ordinathorreur](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ordinathorreur/32/536_2.png) [@Ordinathorreur](https://forum.kirupa.com/u/Ordinathorreur)
#### Post date: [August 5, 2004, 9:23pm UTC](https://forum.kirupa.com/t/combining-converting-variables/118484/1 "2004-08-05T21:23:53Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Carixpig](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carixpig/32/304_2.png) [@Carixpig](https://forum.kirupa.com/u/Carixpig)
#### Post date: [August 6, 2004, 1:43am UTC](https://forum.kirupa.com/t/combining-converting-variables/118484/2 "2004-08-06T01:43:49Z")

</div>

I’d use  
[AS]  
on(release){  
picCap++;  
\_root.piccount.text = (picnumber + “/” + picCap + " " + loadText[“pic” + picCap]);  
}  
[/AS]

Hope this helps some.

---

<div class="post-metadata">

### Author: ![Ordinathorreur](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ordinathorreur/32/536_2.png) [@Ordinathorreur](https://forum.kirupa.com/u/Ordinathorreur)
#### Post date: [August 6, 2004, 3:22pm UTC](https://forum.kirupa.com/t/combining-converting-variables/118484/3 "2004-08-06T15:22:39Z")

</div>

Thanks, Ill give it a try tonight! 🙂
