PDA

View Full Version : byts per second



dajojo88
April 16th, 2003, 09:35 PM
is there any way to diplay the bytes (or kilobytes) per second in flash. (for use in a preloader)

richie
April 17th, 2003, 10:39 AM
http://www.romiglia.com/web/

he haves a preloader with this function

pom
April 17th, 2003, 10:49 AM
You get the bytes loaded with yourClip.getBytesLoaded() and the time since the beginning of your movie with getTimer()...

dajojo88
April 17th, 2003, 04:17 PM
thanks for all ur help

raichu
May 5th, 2003, 03:13 PM
thanx!!!! this is gonna be great for my game!:love:

Keith130
June 2nd, 2003, 01:14 PM
How do you work it out Im in a thick kinda mood so I still doint get it

Is it just txtTime = Math.round(getBytesTotal() / getTimer()) + " s"

I dont know

pom
June 2nd, 2003, 03:25 PM
For instance, you could have on the first frame of your movie:
time = getTimer();
this.onEnterFrame = function(){
var elapsedTime = (getTimer() - time) / 1000; // to get it in seconds
var kiloBytesLoaded = this.getBytesLoaded / 1024;
var rate = kiloBytesLoaded / elapsedTime;
trace (rate);
}Something like that...

dajojo88
June 6th, 2003, 11:18 PM
alrihgt, thanks a lot, this worked great