PDA

View Full Version : specifying the amount of bytes you want to load


atslopes
11-16-2004, 03:10 PM
This code is fine it works my e-card is about 600k i want to load about 100k and let the user play the movie not wait until all 600k is loaded.

By the way on a 56k modem what do u all recommend the the total bytes loaded before i start the card. I also dont want them to wait too long.


bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}
:)

deadbeat
11-16-2004, 04:59 PM
Just change this line:

if (bytes_loaded == bytes_total) {

to:

if (bytes_loaded == 100) {

Or whatever value you want to load before beginning...

K.

zzcoopzz
11-16-2004, 06:50 PM
Now I have been having trouble with this type of code, and cached files.

if I want the file to load at 25% and the file is already loaded it skips right by 25% and doesn't play.

basically it says if 25% is loaded then go to and play. as you know computers are very logical and if it jumps right to 100% then it doesn't hit at 25%.

you might want to test this out before going live with it (obviously).

coop