# Drawing API - Draw rectangle by dragging mouse on canvas

**URL:** <https://forum.kirupa.com/t/drawing-api-draw-rectangle-by-dragging-mouse-on-canvas/89640>\
**Category:** flash\
**Created:** [May 10, 2005, 10:48am UTC](https://forum.kirupa.com/t/drawing-api-draw-rectangle-by-dragging-mouse-on-canvas/89640 "2005-05-10T10:48:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![faridur](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@faridur](https://forum.kirupa.com/u/faridur)\
**Post date:** [May 10, 2005, 10:48am UTC](https://forum.kirupa.com/t/drawing-api-draw-rectangle-by-dragging-mouse-on-canvas/89640/1 "2005-05-10T10:48:19Z")

</div>

[font=Georgia]I need to to incorporate a functionality where the user can use his mouse to draw a rectangle by dragging his mouse over the canvas - much like the Rectangle Drawing Tool in the Flash Authoring environment. The requirement is something like a rubberband tool where the user can define a portion of a map by drawing a rectangle over it. The coordinates needs to be captured. Can anyone help me with the actionscript.[/font]
