Draggable api lines

I wonder if anyone can help with this?

I’ve been trying to get draggable api lines to work, have pretty much got it 100% except for 1 problem. The idea is that the user needs to draw on the stage 3 lines (this is to create a graph) I have it where they can click then drag over the graph and a line appears. The problem comes when the user clicks and doesnt drag. This clicking registers a mouse down and moves onto the next line.
So if the user were to click on the stage 3 times they are unable to draw any line until they click the reset button. While this isnt a major problem its something that I’d like to solve.

below is the code that is used to create one of the lines, everytime the users mouse is up _global.i goes up 1 until it reaches 4 when they cant draw anymore.

onClipEvent(mouseDown){
    if (_global.i == 1){
        xStart = 50*Math.round(_xmouse/50);
        yStart = 50*Math.round(_ymouse/50);
        this.onMouseMove = function(){
            if (_global.i == 1){
                this.createEmptyMovieClip("line1", 1);
                this.line1.lineStyle(3, 0xff0000, 100);
                this.line1.moveTo(xStart, yStart);
                this.line1.lineTo(50*Math.round(_xmouse/50), 50*Math.round(_ymouse/50));
            }
        }
    }
}
onClipEvent(mouseUp){
    if (_global.i == 1){
        _global.line1Height = this.line1._height;
        _global.line1Width = this.line1._width;
        _global.line1xStart = xStart;
        _global.i = 2;
    }
}

I dont feel like I’ve explained this very well so I’ve attached the .fla as well