# The random image thread

**URL:** <https://forum.kirupa.com/t/the-random-image-thread/171279>\
**Category:** flash\
**Created:** [December 3, 2005, 5:13pm UTC](https://forum.kirupa.com/t/the-random-image-thread/171279 "2005-12-03T17:13:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomms](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tomms](https://forum.kirupa.com/u/tomms)\
**Post date:** [December 3, 2005, 5:13pm UTC](https://forum.kirupa.com/t/the-random-image-thread/171279/1 "2005-12-03T17:13:06Z")

</div>

alright i looked around the site and i couldnt find an answer to this question, so here goes…

I have managed to make a function that calls a random image, however i am unable to call the Correct description and picture number (’ p ')…i know why this is but i am clueless on how to go about fixing it…

thanks for any help…

p=0;  
function randomimg() {  
if (loaded == filesize) {  
if (p\<(total-1)) {  
p++;  
myNumber = Math.floor(Math.random()\*image.length);  
picture.loadMovie(image[myNumber]);  
desc\_txt.text = description[p];  
picture\_num();  
picture.\_alpha = 0;  
}  
}  
}

function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / "+total;  
}
