# Flash CS3 Need help with 'Not another loading random image question'

**URL:** <https://forum.kirupa.com/t/flash-cs3-need-help-with-not-another-loading-random-image-question/247152>\
**Category:** flash\
**Created:** [December 18, 2007, 10:49pm UTC](https://forum.kirupa.com/t/flash-cs3-need-help-with-not-another-loading-random-image-question/247152 "2007-12-18T22:49:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Codeflunky](https://avatars.discourse-cdn.com/v4/letter/c/e19b73/32.png) [@Codeflunky](https://forum.kirupa.com/u/Codeflunky)\
**Post date:** [December 18, 2007, 10:49pm UTC](https://forum.kirupa.com/t/flash-cs3-need-help-with-not-another-loading-random-image-question/247152/1 "2007-12-18T22:49:58Z")

</div>

Hi, first post so hope I have the right section.

Total amateur who has been searching for the answer without much luck.

With help from here (Lurking) I have managed to build a movie that randomly loads three images (probably will end up with more than this).

I would like the movie to load a new image each time the page is reloaded and have ended up with this:

var myImageSequence = 3;  
var myRandomNumber = Math.floor(Math.random()_myImageSequence)+1;  
var myImageName = myRandomNumber + “.jpg”;  
loadMovieNum(myImageName, 1);  
var a:Array = new Array();  
for(i=0;i\<15;i++){  
a_ = i;  
}

var stored:Number = Math.ceil(Math.random()\*a.length-1);// generate first random number to store in memory  
function randomNumber() {  
var n:Number = Math.ceil(Math.random()\*a.length-1);//generate random number for display  
if (n == stored) {  
ran();//run function again  
} else {  
stored = n; //store new random number into memory if not matching  
trace(a[n]);  
}  
}  
var timer = setInterval(function () {  
randomNumber();  
}, 3);

Obviously not working and would be very grateful if someone could help.

Thanks
