I would like to add in caption text and photo number indicator to this tutorial:
http://www.kirupa.com/developer/mx/photogallery.htm
- 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.
- 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.