# Changing the value of the preloader bar

**URL:** https://forum.kirupa.com/t/changing-the-value-of-the-preloader-bar/97181
**Category:** Uncategorized
**Created:** [December 18, 2003, 7:21pm UTC](https://forum.kirupa.com/t/changing-the-value-of-the-preloader-bar/97181 "2003-12-18T19:21:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![w9914420](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@w9914420](https://forum.kirupa.com/u/w9914420)
#### Post date: [December 18, 2003, 7:21pm UTC](https://forum.kirupa.com/t/changing-the-value-of-the-preloader-bar/97181/1 "2003-12-18T19:21:55Z")

</div>

This code is taken from the an example done by Claudio

preloader bar is exactly 100px and works correctly with the percentage value  
I had a little mess around with changing the preloaders width value to 200  
and it only displayed half of the preloader.

I was just wondering HOw would I change the code so that I can Have a Preloader  
that is customable to my design. e.g say if my preloader is 150 px long how would  
I make it work in relation to a percentage value. I am complete newbie to action script  
so any help would be most thank full.

THE CODE

this.createEmptyMovieClip(“temp”, 1000);  
function preload() {  
this.transition.txtPercentage = “”;  
temp.onEnterFrame = function() {  
var t = this.\_parent.content.getBytesTotal(), l =  
this.\_parent.content.getBytesLoaded();  
var percent = Math.round(l\*100/t);  
if (!isNaN(t)) {  
if (t\>0 & l == t) {  
this.\_parent.transition.gotoAndPlay(“opening”);  
this.\_parent.transition.txtPercentage = “Complete”;  
delete this.onEnterFrame;  
} else {  
this.\_parent.transition.loadBar.\_width = percent;  
this.\_parent.transition.txtPercentage = percent+" %";  
}  
}  
};  
}
