# Problems with preloader

**URL:** https://forum.kirupa.com/t/problems-with-preloader/210626
**Category:** Uncategorized
**Created:** [December 20, 2006, 2:20pm UTC](https://forum.kirupa.com/t/problems-with-preloader/210626 "2006-12-20T14:20:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hema77](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@hema77](https://forum.kirupa.com/u/hema77)
#### Post date: [December 20, 2006, 2:20pm UTC](https://forum.kirupa.com/t/problems-with-preloader/210626/1 "2006-12-20T14:20:26Z")

</div>

Hi!..I got a problem with a preloader… doesn’t show from the beginning…just when the .swf is about to load. This is the code:

var root:MovieClip = this;  
root.onEnterFrame = function() {  
tot = root.getBytesTotal();  
car = root.getBytesLoaded();  
por = Math.round((car\*100/tot));  
textoPrecarga.text = “Cargando… “+por+”%”;  
barra.\_xscale = por;  
if (tot == car && car\>0) {  
delete root.onEnterFrame;  
}  
};

It just happens with some .swf files… and I don’t know if it is to do with the structure of these 'cause there are buttons with load movieclips …eg:

on(release) {  
picture.attachMovie(“alum3”, “loadedMovie”, 2);

}
