External preloader problem

Hey, i have this preloader for loading external files, it works pretty good, except i’m having a problem…

Check this: http://www.falloutbmx.com/layout2/layout2.html

It’s not done, but press the main button just for testing purposes, it loads a video, here is where the problem is, the video appears before the preloader is done loading…i can’t figure out why…

here is the AS for the preloader:


_root.bar._visible = 0;
_root.barBorder._visible = 0;

MovieClip.prototype.loadPic = function(pic) {

this.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = media.getBytesTotal(), l = media.getBytesLoaded();
bar._visible = 1;
barBorder._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && media._width != 0) {

bar._visible = 0;
barBorder._visible = 0;
loadText3.text = "";
delete this._parent.onEnterFrame;
} else {
bar._width = per * 2;
loadText3.text = per+" % loaded";
}
};
};

adapted from the resizing image thing…anyone know why the movie being loaded is appearing before its done loading?

also, the sound is messed up after loading them, why would that cause a problem with the sound? these are the same vids i used before, and the sound is fine…