Help with creating a measuring tool

Hi there,

I’m currently working on a project whereby you can create various points on a canvas and these are measured from point to point at a certain scale. So far I have only come across simple paint tools but I am looking for something whereby I can create geometric shapes using straight lines. I’m not looking for these to be snapped on a point or anything like that, however. Think of Photoshop’s line tool but a continuous version which “unsnaps” when you press Esc or something.

Below is what I have so far:


this.createEmptyMovieClip("canvas_mc", 999);
var isDrawing:Boolean = false;
//
clear_btn.onRelease = function() {
    canvas_mc.clear();
};
//
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
    canvas_mc.lineStyle(5, 0xFF0000, 100);
    canvas_mc.moveTo(_xmouse, _ymouse);
    isDrawing = true;
};
mouseListener.onMouseMove = function() {
    if (isDrawing) {
        canvas_mc.lineTo(_xmouse, _ymouse);
        updateAfterEvent();
    }
};
mouseListener.onMouseUp = function() {
    isDrawing = false;
};
Mouse.addListener(mouseListener);

(note: to get the above example working you will need to create a movie clip button with the instance name “clear_btn”)

If anyone has any thoughts on tutorials or any other information which may be of use I would be very grateful.

Cheers,

KugarWeb