# Load Random Image with Caption XML issue

**URL:** <https://forum.kirupa.com/t/load-random-image-with-caption-xml-issue/279346>\
**Category:** Uncategorized\
**Created:** [January 13, 2009, 7:09pm UTC](https://forum.kirupa.com/t/load-random-image-with-caption-xml-issue/279346 "2009-01-13T19:09:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rynobot](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rynobot](https://forum.kirupa.com/u/rynobot)\
**Post date:** [January 13, 2009, 7:09pm UTC](https://forum.kirupa.com/t/load-random-image-with-caption-xml-issue/279346/1 "2009-01-13T19:09:43Z")

</div>

I’ve search, but cannot find the answer. Based on the kirupa xml gallery I am loading a random image opposed to starting with the first image in the xml file. It works fine, but I have not been able to figure out how to get the accompanying caption to load with the specific image. Does anyone know the correct way to right the following:

```auto
function loadImage() {
	if (loaded == filesize) {
		picture._alpha = 0;
		picture.loadMovie(image[random(total)],1);
		picture_num();
		descTxt = description[0];
	}
}

```

I know it has to do with this: “description[0];”  
I’m just not sure what to change the ‘0’ too…???

thanks in advance.
