# Combining/converting Variables

**URL:** https://forum.kirupa.com/t/combining-converting-variables/60040
**Category:** flash
**Created:** [August 5, 2004, 9:23pm UTC](https://forum.kirupa.com/t/combining-converting-variables/60040 "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/60040/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: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 6, 2004, 1:43am UTC](https://forum.kirupa.com/t/combining-converting-variables/60040/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: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 6, 2004, 3:22pm UTC](https://forum.kirupa.com/t/combining-converting-variables/60040/3 "2004-08-06T15:22:39Z")

</div>

Thanks, Ill give it a try tonight! 🙂
