# Urgent Drawing API help Please

**URL:** https://forum.kirupa.com/t/urgent-drawing-api-help-please/221693
**Category:** flash
**Created:** [April 6, 2007, 1:46pm UTC](https://forum.kirupa.com/t/urgent-drawing-api-help-please/221693 "2007-04-06T13:46:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![PrinceTaj](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PrinceTaj](https://forum.kirupa.com/u/PrinceTaj)
#### Post date: [April 6, 2007, 1:46pm UTC](https://forum.kirupa.com/t/urgent-drawing-api-help-please/221693/1 "2007-04-06T13:46:26Z")

</div>

Hi guys,

I need some help with modifying the behaviour of the drawing API in flash (See below). Basically, I need to know how I can make it so that only straight lines can be drawn at right angles. If anybody can help, would be much appreciated.

```auto

this.createEmptyMovieClip("canvas_mc", 999);
var isDrawing:Boolean = false;
//
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
    canvas_mc.lineStyle(5, 0x000000, 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);

```

Many Thanks

TAJ
