Q:

Drawing a line ActionScript 3 not working

Hello everyone i have a piece of code for drawing a simple line but it doesn`t do it if it is possible to tell me where is my mistake i will be very thankful!!! Here is the code:
function click2(e:MouseEvent):void{
    e.currentTarget.removeEventListener(MouseEvent.CLICK, click2);
    fx=mouseX;
    fy=mouseY;
    var i:int;
    i=2;
    trace(i);
    trace(sx,sy);
    trace(fx,fy);
    var  line:Shape = new Shape();
    line.graphics.beginFill(0x0066FF);
    line.graphics.moveTo(400, 300);
    line.graphics.lineTo(400, 400);
    this.addChild(line);
}

Thank you very much , i really appreciate the community of this website, and you guys really help me to see my mistakes, im just a beginner but im doing well just becouse of YOU the people with heart!!!

A:

You are drawing a line so you have to set the lineStyle:
function click2(e:MouseEvent):void {
    e.currentTarget.removeEventListener(MouseEvent.CLICK, click2);
    fx=mouseX;
    fy=mouseY;
    var i:int;
    i=2;
    trace(i);
    trace(sx,sy);
    trace(fx,fy);
    var line:Shape = new Shape();
    line.graphics.lineStyle(1, 0x0066FF, 1);
    line.graphics.moveTo(400, 300);
    line.graphics.lineTo(400, 400);
    this.addChild(line);
}

