# How do I apply this code to a new movie clip

**URL:** <https://forum.kirupa.com/t/how-do-i-apply-this-code-to-a-new-movie-clip/114476>\
**Category:** Uncategorized\
**Created:** [June 28, 2004, 10:59pm UTC](https://forum.kirupa.com/t/how-do-i-apply-this-code-to-a-new-movie-clip/114476 "2004-06-28T22:59:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamsterhead](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@Hamsterhead](https://forum.kirupa.com/u/Hamsterhead)\
**Post date:** [June 28, 2004, 10:59pm UTC](https://forum.kirupa.com/t/how-do-i-apply-this-code-to-a-new-movie-clip/114476/1 "2004-06-28T22:59:14Z")

</div>

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:

```auto

 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
