# Preload code

**URL:** <https://forum.kirupa.com/t/preload-code/150425>\
**Category:** Uncategorized\
**Created:** [June 7, 2005, 3:01pm UTC](https://forum.kirupa.com/t/preload-code/150425 "2005-06-07T15:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![francesca\_69](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@francesca\_69](https://forum.kirupa.com/u/francesca_69)\
**Post date:** [June 7, 2005, 3:01pm UTC](https://forum.kirupa.com/t/preload-code/150425/1 "2005-06-07T15:01:58Z")

</div>

I created a simple preload and it isn’t working. Here is the code: for the first frame:

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = getPercent_100;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(“Scene 1”,480);  
}

And for the second frame:

this.gotoAndPlay(“preloader”,1);

I made the preloader movie as a separate scene called “preloader”.  
Does anyone out there know if this code is correct? I tried to test it, and it I can’t see the preload movie. I selected under the “view” menu - simulate download, so as to be able to see the preloader, but no luck! Thanks in advance.

-F
