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
//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);
}