You should have a look at some tutorials, it'll help alot.
Here is some of my code:
PHP Code:
onClipEvent (enterFrame) {
loaded = _root._level2.getBytesLoaded(); //the number of bytes that's already loaded
total = _root._level2.getBytesTotal(); //the total of bytes
var percent
percent = (loaded/total)*100; //generates the percent var
showpercent = Math.round(percent)+"%"; //shows a percent and %
this.preloadbalk._width = (this.preloaderbar._width/100)*percent; //changes the width of your bar
if (percent == 100){ //if the var percent is equal to 100 this.nextFrame() will be executed
this.nextFrame()
}
}
Hope it helps you...