# Moving a clip made from createEmptyMovieClip

**URL:** <https://forum.kirupa.com/t/moving-a-clip-made-from-createemptymovieclip/51095>\
**Category:** Uncategorized\
**Created:** [May 9, 2004, 9:28pm UTC](https://forum.kirupa.com/t/moving-a-clip-made-from-createemptymovieclip/51095 "2004-05-09T21:28:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![koorb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/koorb/32/424_2.png) [@koorb](https://forum.kirupa.com/u/koorb)\
**Post date:** [May 9, 2004, 9:28pm UTC](https://forum.kirupa.com/t/moving-a-clip-made-from-createemptymovieclip/51095/1 "2004-05-09T21:28:48Z")

</div>

I can’t seem to move a clip I created with the createEmptyMovieClip() function. the trace shows the \_x and \_y changing but nothing on the screen moves an inch. I have tried searching and found some threads but nothing that helped ☹ stuff about making sure the \_root and what not was specified correctly. If you have some time test my code (will run in just a new fla)  
I’ll be your friend if you help :love:(-: TIA

```auto

 //draw a dashed line
 function dashed_line(width, xy, size, spacing, weight, color, alpha) {
 
     //defaults
     width = width ? width : 500;
     xy = xy ? xy : 'x';
     size = size ? size : 5;
     spacing = spacing ? spacing : 5;
     weight = weight ? weight : 1;
     color = color ? color : 0x51524E;
     alpha = alpha ? alpha : 100;
     
     count = 0;
     
     //start line
     lineStyle(weight, color, alpha);
     
     while (count < width) 
     {    
         //determin weather to draw the line on the x or y axis
         if (xy == 'x')
         {
             x_move = count;
             y_move = 0;
             
             x_draw = count+size;
             y_draw = 0;
         }else{
             x_move = 0;
             y_move = count;
             
             x_draw = 0;
             y_draw = count+size;
         }
         
         //move the pen
         moveTo(x_move, y_move);
         lineTo(x_draw, y_draw);
         
         //increase count
         count = count+size+spacing;
     }
 }
 
 //create a horozontal dashed line
 createEmptyMovieClip('hline_mc', 0);
 
 with (hline_mc) {
     dashed_line(200,'x',5,1,.1,0x51524E,50);
 }
 
 //create a virtical dashed line
 createEmptyMovieClip('vline_mc', 1);
 
 with (vline_mc) {
     dashed_line(200,'y',5,1,.1,0x51524E,50);
 }
 
 hline_mc.onEnterFrame = function () {
     hline_mc._y = _root._ymouse;
     trace('hline_mc._y = '+hline_mc._y);
 }
 
 vline_mc.onEnterFrame = function () {
     vline_mc._x = _root._xmouse;
     trace('vline_mc._x = '+vline_mc._x);
 }
 

```
