A tricky problem ?!?

Hi there…

Again some probs with the preloader…

The preloader works fine using this code

bytes_geladen = int(_root.getBytesLoaded())/1024 add " KB geladen";
bytes_gesamt = int(_root.getBytesTotal())/1024 add " KB gesamt";
prozent = int(_root.getBytesLoaded() *100/_root.getBytesTotal()) add " % geladen";
if (prozent == “100 % geladen”) {
gotoAndPlay (3);
}

the only problem ist that the var that give out the amount of total bytes shows bytes and not KB… get.Bytes.Loaded is functioning properly… any suggestions how i can geht the KB of total bytes to be shown ?!?

bytes_geladen = int(_root.getBytesLoaded())/1024 add " KB geladen";
bytes_gesamt = int(_root.getBytesTotal())/1024 add " KB gesamt";

Your problem lies in the fact that you are dividing.

The getBytesLoaded and getBytesTotal methods get the bytes. So by dividing by 1024 you are saying that there are 1024kb in 1 byte, but there are really 1024 bytes in 1kb.

So with that said your code will go from dividing, to multiplying, so it is saying that there are 1024 bytes in 1kb.

bytes_geladen = int(_root.getBytesLoaded())*1024 add " KB geladen";
bytes_gesamt = int(_root.getBytesTotal())*1024 add " KB gesamt";

mhhh… i wil try out …

thx for ur help

Good Luck :slight_smile: