Preloading speed...?

is there anyway to get how fast the movie is d/l at\ras in kps or anything??

Sure… there’s a great tool in Flash for that.\r\rDo a test movie, menu option “Control/Test Movie” (or CTRL+Enter). While that’s running, go into the menu option “View” and click on “Show streaming”. Now, under control you can choose between three predefined modem speeds, or you can set your own. Choose one and hit Ctrl+Enter again. The movie will play, as a person with that connection speed would see it.\r\rThe bandwidth profiler is nice all in it’s own. You can see which frames take the longest to download with the graph there.

how can i put that into a preloader???\r\ris that possible?\rto put the speed at which the user is preloading the movie?

you can use getTimer() with getBytesLoaded() to see how much has downloaded over how long. from that you get an average kb/s.\r\rwhen the download is initiated, set a variable that contains when it started:

   \r\ron(release){\r\r   loadMovieNum("big.swf",10);\r\r   startTime = getTimer();\r\r}

\rthen in your preloading code, use that to see how long it’s been, using that to get kb/s:

   \r\r   total = _level10.getBytesTotal();\r\r   loaded = _level10.getBytesLoaded();\r\r   percent = loaded/total * 100;\r\r   elapsedTime = getTimer() - startTime;\r\r   kbs = loaded / (elapsedTime/1000);

\ryou divide by 1000 because getTimer() returns time in milliseconds.\r\ryou can extrapolate on this to get a current download speed by storing the total each second and then finding the difference between then and now:\r

   \r\r   if(getTimer() - cur_start >= 1000){\r\r      kbsLastSecond = cur_total - total\r\r      cur_total = total;\r\r      cur_start = getTimer();\r\r   }

\r

k… so wat varible is the speed?\r\rlol cur start or total…or kbs?