# Preloader

**URL:** <https://forum.kirupa.com/t/preloader/219775>\
**Category:** Uncategorized\
**Created:** [March 20, 2007, 1:48am UTC](https://forum.kirupa.com/t/preloader/219775 "2007-03-20T01:48:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![driz](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@driz](https://forum.kirupa.com/u/driz)\
**Post date:** [March 20, 2007, 1:48am UTC](https://forum.kirupa.com/t/preloader/219775/1 "2007-03-20T01:48:04Z")

</div>

Hi I would like to add a simple preloader to my flash movie, basically i want a movie clip of an animation to play on one layer, and not move to the next frame until all of the flash movie has loaded.

Im using the following code:

```auto
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
if (bytes_loaded == bytes_total) {
	_root.gotoAndStop(3);
}

```

But for some reason the movie loads, and then displays the preloader.  
Making the loader useless as its only displayed after the movie has loaded.

Does anyone have a really basic code to make sure the movie loads before moving forward, but displaying a movieclip too.

I have looked around on the net, but all are either ifFrameLoaded, or preload bars.
