Preloader bar

hey
im making a site and i have everything done, except i cant get the preloader bar to work!
heres my script, that i ve copied from a tutorial online.

// variable to hold the value of total frames in this movie
var loadAmount = _totalframes;
// loops until the frames loaded >= to frames in this movie
if (_framesloaded >= loadAmount) {
// when framesloaded then move play head to frame called ‘start’
gotoAndStop(2);
} else {
// otherwise do these calcualtions and display them on the scene
// to show how much of the movie has been loaded.
// variable to store the amount of bytes loaded so far
loaded = Math.round(getBytesLoaded());
// variable to store the total bytes of this movie
total = Math.round(getBytesTotal());
// calculate how much has been loaded and work that out as a percentage
percent = Math.round((loaded/total) * 100);
// labels to display on the preloader scene
bytesLoadedOutput = loaded;
bytesTotalOutput = total;
percentOutput = percent + “%”;
// draw the progress bar
pb.pbBar._width = pb.pbHolder._width * (percent / 100);
// loop the preloader scene.
gotoAndPlay(1);
}