# Help with creating a measuring tool

**URL:** <https://forum.kirupa.com/t/help-with-creating-a-measuring-tool/330237>\
**Category:** flash\
**Created:** [December 17, 2012, 5:00pm UTC](https://forum.kirupa.com/t/help-with-creating-a-measuring-tool/330237 "2012-12-17T17:00:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kugarweb](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@Kugarweb](https://forum.kirupa.com/u/Kugarweb)\
**Post date:** [December 17, 2012, 5:00pm UTC](https://forum.kirupa.com/t/help-with-creating-a-measuring-tool/330237/1 "2012-12-17T17:00:33Z")

</div>

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:

```auto

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
