Another newbie preloader predicament

In F8, I created a loading bar using the instance “loadBar”. I then inserted the following actionscript in a keyframe in an empty layer. It doesnt seem to work.

stop();
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(6);
}

Can someone help me a bit here? thx in advance