Full width screen, page progress bar (loadbar)

hello guys,

im trying to create a loadbar whichyou may already seen in many gallery or portfolio site. its the kind of loadbar that shoots accross the screen until the content or image is fullt loaded. my current AS dosent work. any help?

my code:

onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
if (percent == undefined) percent = 0;
percent -= (percent-((loading/total)100Stage.width))*.25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;
if (percent>99) {
_parent.gotoAndStop(2);
}
}