Incremental percentage buffering

Hi,

I’m building a site using lots of live action footage similar to this (http://www.shaveeverywhere.com), and want a buffering system, whereby say 10% of the FLV loads, then gets the video to play. I’d like a constant check on the percentage loaded, so that there is always an extra 10% of the video loaded to ensure smooth playback. If that percentage loaded drops below the 10% extra mark, the video should pause and a buffering message appear, while the percentage loaded gets above that extra 10% buffer mark.

I can’t use the netStream setBuffer property, as it screws with cue points I have in the video.

This is the start of the code I’ve got at the moment:

if (_root.getBytesLoaded() > 0)
{
percentDone = Math.floor(_root.getBytesLoaded() / _root.getBytesTotal() * 100);
loaderVideo.gotoAndStop(percentDone);

    trace("percentDone: " + percentDone);
    if (percentDone >= 1)
    {
        if (percentDone < (percentDone + 2)) {
            stop();
            currentLoaded = percentDone;
            buffering._visible = true;
        } else {
            buffering._visible = false;
            play();
        }
                  clearInterval(intervalID);

All this code is in an interval. At the moment, every time that statement is checked, it is going to be working from a new percentageLoaded number, so it needs to lock in a number from the instant that percentage falls BELOW the 10% buffer, and keep working from that same percentage until the buffer goes above the 10% mark.
I used 1% as a test, and added 2% on to that for checking the buffer.

I’m not entirely sure I’ve explained this properly, in fact I’m almost positive I haven’t as I’ve confused myself, but if anyone has any idea what I’m talking about, and can offer a solution, I’d be massively grateful.

Olly.