Preloader code?!

upon loading a swf, i have this code…which works great…
what i am trying to do is, for a button on that same swf, have it load and external swf into a target, with the same code in the external swf…

but when i load it…it goes back and loads the previous swf…
i think i got something wrong with the roots, right???
help!!!
thanks


onClipEvent (load) {
 total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
 loaded = _root.getBytesLoaded();
 percent = int(loaded/total*100);
 text = percent+"%";
 gotoAndStop(percent);
 if (loaded == total) {
  _root.gotoAndPlay(8);
 }
}