# Preloader question

**URL:** <https://forum.kirupa.com/t/preloader-question/162675>\
**Category:** Uncategorized\
**Created:** [September 15, 2005, 8:53am UTC](https://forum.kirupa.com/t/preloader-question/162675 "2005-09-15T08:53:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thisnamesux](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@thisnamesux](https://forum.kirupa.com/u/thisnamesux)\
**Post date:** [September 15, 2005, 8:53am UTC](https://forum.kirupa.com/t/preloader-question/162675/1 "2005-09-15T08:53:31Z")

</div>

hi there,  
i followed the tutorial on creating a preloader, works like a charm, however, i want it so it runs each time the site is loaded…  
basically, weather the swf. is loaded into the cache or not.

below is the code:

bytes\_loaded = Math.round(\_root.getBytesLoaded());  
bytes\_total = Math.round(\_root.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
\_root.loadBar.\_width = getPercent_100;  
loadTextTemp = Math.round(getPercent_80+70);  
\_root.loadText = loadTextTemp  
\_root.loadText.\_x += 1;  
if (loadTextTemp \> 88) {preloadertext.gotoAndPlay(2);  
}  
if (loadTextTemp \> 110) {  
\_root.preloadertext.gotoAndPlay(“fadesweat”);  
}  
if (loadTextTemp \> 130) {  
\_root.preloadertext.gotoAndPlay(“fademove”);  
}  
if (bytes\_loaded == bytes\_total) {  
\_root.gotoAndStop(3);  
}

i was thinking maybe some way of setting Bytes\_Loaded to 0 each time?  
What you think?

Alex
