# Partial preloader help

**URL:** <https://forum.kirupa.com/t/partial-preloader-help/300968>\
**Category:** Uncategorized\
**Created:** [December 1, 2009, 3:10pm UTC](https://forum.kirupa.com/t/partial-preloader-help/300968 "2009-12-01T15:10:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gooflett](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@gooflett](https://forum.kirupa.com/u/gooflett)\
**Post date:** [December 1, 2009, 3:10pm UTC](https://forum.kirupa.com/t/partial-preloader-help/300968/1 "2009-12-01T15:10:06Z")

</div>

I found this code on the best of Kirupa and was wondering how I could modify this code to go to and play frame 2 after it has loaded a certain number of kilobytes or a certain percentage.

I would like it it to preload 1/4 of the total kb and then play. Currently it loads the whole enchilada.

Thanks for the help.

//here we are getting the total bytes and the number of  
//bytes that have been loaded so far, of the movie, and  
//dividing it by 1000 in order to come up with killobytes.  
//we set two variables to be equal to these two statements  
//like so  
totalK=getBytesTotal()/1000;  
loadedK=getBytesLoaded()/1000;  
//remaining K is just the first variable, minus the second.  
remainingK=totalK-loadedK;  
//percentage of K loaded is just the second variable divided  
//by the first, and then mutliplied by 100.  
percentageK=(loadedK/totalK)\*100;  
//here we set the bar movie clip to scale, left/right by the  
//amount of the percentage variable.  
setProperty(“bar”,\_xscale,percentageK);  
//here is our break out… if the amount of K loaded is greater  
//than the total K of the movie, AND (that’s what && means…  
//both conditions have to be true) the total K is NOT equal to  
//0, then goto the third frame.  
if(loadedK\>=totalK&&totalK!=0){  
gotoAndPlay(3);  
}
