# Confusing preloader maths

**URL:** <https://forum.kirupa.com/t/confusing-preloader-maths/174824>\
**Category:** Uncategorized\
**Created:** [January 9, 2006, 5:16pm UTC](https://forum.kirupa.com/t/confusing-preloader-maths/174824 "2006-01-09T17:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipsb\_13](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@dipsb\_13](https://forum.kirupa.com/u/dipsb_13)\
**Post date:** [January 9, 2006, 5:16pm UTC](https://forum.kirupa.com/t/confusing-preloader-maths/174824/1 "2006-01-09T17:16:39Z")

</div>

Hey all I’m trying to get my head around preloaders and am getting there just confused with the maths part of it all.

the preloader I have is basically a movieclip where once a certain amount of bytes are loaded it will go to the next frame of the movieclip

because I want to do it on the basis of bytes i want the number of bytes to equal the number of frames within the movieclip - hope this makes sense so far.

Heres the info from my flash movie:

## Movie: dim: 750 X 400 pixels fr rate: 30.0 fr/sec size: 40KB (41118B) duration: 3fr (0.1s) preload: 355fr (11.8s)

## Settings: Bandwidth: 4800 B/s (160 B/fr)

State:  
Frame: 2  
0KB (98B)  
loaded: 100% (3 frames)  
55KB (57195B)

#####################################  
AND HERE IS THE CODE ON MY PRELOADER:  
#####################################

onClipEvent (enterFrame) {  
\_root.totalBytesBox = Math.round(\_root.getBytesTotal()/41118);  
\_root.loadedBytesBox = Math.round(\_root.getBytesLoaded()/41118);  
totalBytes = Math.round(\_root.getBytesTotal()/41118);  
loadedBytes = Math.round(\_root.getBytesLoaded()/41118);  
if (loadedBytes\<2) {  
\_root.text.gotoAndStop(“label1”);  
} else if (loadedBytes\<4) {  
\_root.text.gotoAndStop(“label2”);  
} else if (loadedBytes\<6) {  
\_root.text.gotoAndStop(“label3”);  
} else if (loadedBytes\<8) {  
\_root.text.gotoAndStop(“label4”);  
} else if (loadedBytes\<10) {  
\_root.text.gotoAndStop(“label5”);  
} else if (loadedBytes\<12) {  
\_root.text.gotoAndStop(“label6”);  
} else if (loadedBytes\<14) {  
\_root.text.gotoAndStop(“label7”);  
} else if (loadedBytes\<16) {  
\_root.text.gotoAndStop(“label8”);  
} else if (loadedBytes\<18) {  
\_root.text.gotoAndStop(“label9”);  
} else if (loadedBytes\<20) {  
\_root.text.gotoAndStop(“label10”);  
} else if (loadedBytes\<22) {  
\_root.text.gotoAndStop(“label11”);  
} else if (loadedBytes\<24) {  
\_root.text.gotoAndStop(“label12”);  
} else if (loadedBytes\<26) {  
\_root.text.gotoAndStop(“label13”);  
} else if (loadedBytes\<28) {  
\_root.text.gotoAndStop(“label14”);  
} else if (loadedBytes\<30) {  
\_root.text.gotoAndStop(“label15”);  
} else if (loadedBytes\<32) {  
\_root.text.gotoAndStop(“label16”);  
} else if (loadedBytes\<34) {  
\_root.text.gotoAndStop(“label17”);  
} else if (loadedBytes\<36) {  
\_root.text.gotoAndStop(“label18”);  
} else if (loadedBytes\<38) {  
\_root.text.gotoAndStop(“label19”);  
} else if (loadedBytes\<40) {  
\_root.text.gotoAndStop(“label20”);  
} else if (loadedBytes\<42) {  
\_root.text.gotoAndStop(“label21”);  
} else if (loadedBytes\<44) {  
\_root.text.gotoAndStop(“label22”);  
} else if (loadedBytes\<46) {  
\_root.text.gotoAndStop(“label23”);  
} else {  
\_root.text.gotoAndStop(“label24”);  
}  
}

* * *

can someone tell me how many bytes I have in my movie - looking at the movie info (and how I find this info out) and also what the mathround number should be: [\_root.totalBytesBox = Math.round(\_root.getBytesTotal()/41118);]

here I have put 41118 - what should it be and how do I work that out?

Sorry for the extra long Q

Hoping somebody can help

Dips
