# Random pictures before preloader

**URL:** <https://forum.kirupa.com/t/random-pictures-before-preloader/238217>\
**Category:** Uncategorized\
**Created:** [September 8, 2007, 12:03pm UTC](https://forum.kirupa.com/t/random-pictures-before-preloader/238217 "2007-09-08T12:03:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theofiel](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@Theofiel](https://forum.kirupa.com/u/Theofiel)\
**Post date:** [September 8, 2007, 12:03pm UTC](https://forum.kirupa.com/t/random-pictures-before-preloader/238217/1 "2007-09-08T12:03:57Z")

</div>

Hi kirupaneers,

I’m designing a website that uses a high quality photo as background. the site has five sections (home, portfolio, etc…) for each section I have 3 high quality photo’s, now I want to load for each section 1 photo at random (so every time you start the site the background is differnt), when I include all pictures the site is like 10 mb. But how to code this before the preloader…

so it would go like this I assume:

random picture selection for five sections --\> pre-load site with random pictures --\> start site

I 'm puzzeled and a bad coder…sorry

my preloader code

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = 986.3_getPercent;  
this.loadTextvak.\_x= this.loadBar.\_width-150;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

Thanks a lot
