How do I apply this code to a new movie clip

ok, So I have a simple (and I mean VERY simple) actionscript to create boxes for websites with the least worry, but I want to take this code from the “_root” and put it into a new movieclip, named (for ease “box1”):

I’ve tried adding stuff to the _root. tag, but I’m missing something fundamental somewhere,

Here’s some of the code:


 stop();
 _root.onLoad=function(){
 	_root.createEmptyMovieClip("mc1",10);
 	_root.createEmptyMovieClip("mc2",11);
 	_root.createEmptyMovieClip("mc3",12);
 	_root.createEmptyMovieClip("mc4",13);
 	speed=10;}
 _root.onEnterFrame=function(){
 _root.createEmptyMovieClip("box",1);
 box.lineStyle(1,0x000000,100);
 box.moveTo(mc1._x,mc1._y);
 box.beginFill(0xBCECF7,50)
 box.lineTo(mc2._x,mc2._y);
 box.lineTo(mc3._x,mc3._y);
 box.lineTo(mc4._x,mc4._y);
 

if someone would just point me in the right direction I’d be much obliged