# Captioning and numbers for photo gallery

**URL:** https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485
**Category:** flash
**Created:** [June 18, 2003, 4:27pm UTC](https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485 "2003-06-18T16:27:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![543312](https://avatars.discourse-cdn.com/v4/letter/5/ea5d25/32.png) [@543312](https://forum.kirupa.com/u/543312)
#### Post date: [June 18, 2003, 4:27pm UTC](https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485/1 "2003-06-18T16:27:17Z")

</div>

I would like to add in caption text and photo number indicator to this tutorial:

[http://www.kirupa.com/developer/mx/photogallery.htm](http://www.kirupa.com/developer/mx/photogallery.htm)

1. caption for each photo:  
I made text file named “animation.txt” with “&image1= this is pea\*\*\*\*, &image2=this is elephant, &image3…” and I put a dynamic text field with instance name of “caption”.

I put this on top of all the code:  
“LoadVariablesNum(“animation.txt”, 0);”  
then I put right under “LoadMovie(this.pathtoPics + this.pArray…”:  
“caption.text=eval(this.pArray[0]);”

The text field shows nothing. what is the correct code to make caption.text display the right text for its corespondent photo? I tried “&image1.jpg= this is pea\*\*\*\*…” in text file and it did not work, either.

1. photo number indicator:  
for each photo displayed, it will show : 1 of 10, 2 of 10, 3 of 10…  
I have 2 text fields with instance names of “currentNum” and “totalNum”. Then at the very end of all the code I put:  
“currentNum.text=this.pIndex;  
totalNum.text=this.pArray.length;”

Well, I got totalNum display the correct number, but the currentNum always stay at “1”, no matter how photo has been changed. I guess I missed something, but I could not figure it out. (note: the tutorial file start with image0, for this purpose I want to start with image1, so I changed “this.pIndex=0” to “this.pIndex=1”).

Thanks in advance.

---

<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: [June 18, 2003, 5:06pm UTC](https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485/2 "2003-06-18T17:06:56Z")

</div>

could you post the fla and text files or the code ? It might be a syntax problem…

---

<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: [June 18, 2003, 5:53pm UTC](https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485/3 "2003-06-18T17:53:44Z")

</div>

Here’s files.

---

<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: [June 18, 2003, 6:05pm UTC](https://forum.kirupa.com/t/captioning-and-numbers-for-photo-gallery/23485/4 "2003-06-18T18:05:50Z")

</div>

Opps, sorry. Here’s the .Fla.

“animation.txt” file saved in same directory as this Fla and contains:

&image1=this is elephant.

&image2=rabbit.

&image3=cat.

&image4=parrot.

&image5=fish.
