Well, assuming the script is inside an MC, and that_root is the thing you need the preloader for, then:

you'll need to put a stop(); in frame 1 of _root or add this line:

_root.stop();

(the stop() in your script isn't going to stop the main timeline).

you'll need to use _root.play();

and you'll need to use

_root.getBytesLoaded() instead of getBytesLoaded()

and _root.getBytesTotal() instead of getBytesTotal()

in your current example, you have essentially written a preloader for your little preloader MC - anything that needs to refer to _root (or the parent clip) needs to be adjusted.