Need urgent Help with a script!

The following code works well on Internet explorer on windows xp, but not in Firefox (xp) and not in safari. Well, occasionally it works, but sometimes it dont:

function loadMovies(target_mc:MovieClip, movieName:String) {
target_mc.loadMovie(movieName);
this.onEnterFrame = function() {
size = target_mc.getBytesTotal();
loaded = target_mc.getBytesLoaded();
percent = (loaded/size);
bar_mc._width = percent*70.0;
if ((size == loaded) && loaded != undefined) {
target_mc.gotoAndPlay(2);
delete this.onEnterFrame;
}
};
}

It loads a swf file, and when it is finished, it sends that loaded swf to frame 2. But why i am having problems?

Any help would be very lovely! :slight_smile: