Preloader goto problem

ok, so I can make “normal” preloaders work, you know, with a bar that goes up and all. But I´’m curious about a preloader wich jumps to a different frame in lets say “loader” MC. I can’t really explain so here’s the code that I thought would work:

bytes_loaded = Math.round(getBytesLoaded());
bytes_total = Math.round(getBytesTotal());
getPercent = bytes_loaded/bytes_total;
if (getPercent = 10) {
loader.gotoAndPlay(2);
}
and so on…

I’m not a good actionscripter, so this is the best I could come up with…

Hope you understand what I’m talking about!
Thanks in advance!