Preload in 25% sections?

Okay, i am trying to make a preloaded that stops on frames depending on how much is loaded, i want it to stay on frame 1 if 24% or less of the movies is loaded and for every 25% i want it to it to move forward a frame,

so far i have done thus,

var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if (bytes / bytes_loaded >= .25) {
_root.gotoAndPlay(2);
} else {
_root.gottoAndStop(1); }

i am not sure if this works or not for i am at work, and will not get to try it for another 6 hours, but many of my past attempts have failed and i doubt this one will work, can anybody help me modify this code to do what i need, thanks a million! kiss, kiss

var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if ((bytes_loaded / bytes) >= .25) {
_root.play();
}

should work for the first frame… ifu want a universal code you can have this:

var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if(Tperfcent==undefined){
Tpercent = .25
}
if ((bytes_loaded / bytes) >= Tpercent) {
Tpercent += .25
_root.play();
}

but if i were u id just edit the first code slightly for each frame you are on…

by the way, just in case, those values will only update each time the frame is loaded… so if you have it on a single frame with a stop() action on it, not a lot is gonna happen :wink:

Prophet.

thank you so much, that makes sense, i am just getting hang of action script, and it seems dumb i even asked the question now, but i guess that’s the nature of learning.

hey no probs mate,

it was a pleasure :slight_smile:

Prophet.

I`m sure Prophets way is fine but i have just made this for someone else;
thought you may want to look.
You have to goto view/streaming to see

stringy what if you want to add a preloading bar or percentage completion for each swf.

have a look at the other thread.