Just prepload 50% then play?

Hi all.
I want just file preload 50% and then it play, 50% remain it will load while playing. But I can’t do it, here is my code:

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;

bytes_total = bytes_total/2; // it will loop because it turn back to play untill full load

_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total ) {

Suppose that my file is 130 kb, and I write my If statement:

if (bytes_loaded == 70000) {

but it doesn’t work too.
what I have to do ?

frame 1

PercentLoaded = getBytesLoaded() / getBytesTotal() * 100;
if (PercentLoaded = 50) {

frame 2


It should say:

if(PercentLoaded >= 50), Skribble. Just to be safe, because it may not equal exactly 50, and even if you knew it would, you’d have if(PercentLoaded == 50)

ah, I see what Dangerskew mean, because the movie can load not exactly 50% (maby 50, …1%) so we need to use >=


Hey scribble, that would’ve been a difference between an A and a B on my comp sci exam. Please watch for the newbies out there that see your code and pull their hair out when it doesnt work. It’s happened to me before and I didnt like the feeling!!!

<-- that was me being too serious. =)