Some AS help?

I’m using the code from the dynamic transition tutorial on kirupa but I want to know what code do I add (and where?) to make a preloader visible (loadbar)?

this is the code

onClipEvent (enterFrame){
if(!loaded&&this._url!=_root._url){
if(this.getBytesLoaded() == this.getBytesTotal()){
loaded=true;
_root.transition.gotoAndPlay(“opening”);
}
}
}

What do you add to make a loadbar? please can someone help I’m stumped!

Thanks guys.