Hi there,
I have been developing a FLV Player and it all runs smoothly except one little weird bug??
I have a function named checkProgress that is set via setInterval and is run every 100ms. This functions code looks like this:
//Check Load Progress Function
function checkProgress():Void {
//Calculate Load Percentage
var nPercent:Number = (nsStream.bytesLoaded / nsStream.bytesTotal) * 100;
trace(nPercent + " Loaded");
}
I have a second function named playHead that is set via another setInterval and is run every 100ms.
This functions code looks like this:
//Play Head Function
function playHead():Void {
//nDuration Variable comes from 'duration' property of nsStream.onMetaData inline Function
var nPercentPlayed = (nsStream.time / nDuration);
trace(nPercentPlayed + " Played");
}
Now for the confusing part…
The percentage loaded begins higher than the percentage played… But as time goes on the equal out and eventually the time played goes further than the percentage loaded…
Within my project I have a bar that grows displaying how much is loaded and a play head that follows… But as per the previous paragraph, whent he played percentage goes above the load you can see it represented in the project graphics.
Whats wrong?
Please help