Copy link to clipboard
Copied
Can somebody help me figure out why this isn't drawing a line? The code is in frame 1 by itself, and I'm not getting any errors.
var brownLineDraw:Shape = new Shape();
brownLineDraw.graphics.lineStyle(12, 0x352000, 1);
brownLineDraw.graphics.moveTo(100, 100);
brownLineDraw.graphics.lineTo(200, 200);
Thanks!
Copy link to clipboard
Copied
I figured it out, you have to add the line to the stage using, in this case:
this.addChild(brownLineDraw);
Hooray!
Copy link to clipboard
Copied
However I have a new problem: the line is supposed to follow things on the stage, and every frame, it makes a new line. Does anybody know how to prevent this?
Copy link to clipboard
Copied
By default a movieclip will loop. You just need to put a stop(); in the frame script (anywhere) to tell Flash not to run the code over and over.