How to make an advanced preloader?

Hi dudes,

Ive been using the code below for preloading on a clients flash movies.

if (_framesloaded>=_totalframes) {
gotoAndPlay (“gallery”,1);
} else {
gotoAndPlay (1);
}

Im quite new so Im not into actionscript that much. I was wondering if any of you know how to make those advanced preloaders which calculate percentage % and play the preloading movie considering it. If you know any tutorials or codes about this can you please tell me?

Thanks a lot,
Liner986