# Preloader for webpage

**URL:** https://forum.kirupa.com/t/preloader-for-webpage/322485
**Category:** flash
**Created:** [May 23, 2011, 9:27am UTC](https://forum.kirupa.com/t/preloader-for-webpage/322485 "2011-05-23T09:27:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pavlos1316](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pavlos1316](https://forum.kirupa.com/u/Pavlos1316)
#### Post date: [May 23, 2011, 9:27am UTC](https://forum.kirupa.com/t/preloader-for-webpage/322485/1 "2011-05-23T09:27:49Z")

</div>

hello all,

I am totally newbie and… most likely my question will be very simple for you… :cubs:

I obtain this code for preloader (I don’t kno if there is anything newer or better):

```auto
loadedBytes = _root.getBytesLoaded(); 
totalBytes = _root.getBytesTotal();  
if (loadedBytes < totalBytes){ 
percentageOutput = int((loadedBytes / totalBytes) * 100); 
_root.loaderBar._xscale = percentageOutput;  
gotoAndPlay("preload_loop"); 
} 
else{ 
gotoAndPlay("begin_movie");  
} 

```

As I understood I put my **file. swf** where the **preload\_loop** is. Correct?  
BUT where/how do I place the code so my file.swf stops when my index.php is loaded and ready to be displayed?

Thank you
