# Flash Drawing API error? (example)

**URL:** <https://forum.kirupa.com/t/flash-drawing-api-error-example/305801>\
**Category:** flash\
**Created:** [March 3, 2010, 6:23pm UTC](https://forum.kirupa.com/t/flash-drawing-api-error-example/305801 "2010-03-03T18:23:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![enridp](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@enridp](https://forum.kirupa.com/u/enridp)\
**Post date:** [March 3, 2010, 6:23pm UTC](https://forum.kirupa.com/t/flash-drawing-api-error-example/305801/1 "2010-03-03T18:23:44Z")

</div>

Hi!  
I think Flash drawing API is not working like it should…  
Test this:

```auto
var W:Number = 12;
var H:Number = 12;

function drawRectExt():void
{
            this.graphics.clear();
            this.graphics.lineStyle(1,0xFF0000);
            this.graphics.beginFill(0xFFFFFF, 1);
            this.graphics.drawRect(0,0,W,H);
            this.graphics.endFill();
}
        
function drawRectInt():void
{
            this.graphics.lineStyle();
            this.graphics.beginFill(0xFF0000, 1);
            this.graphics.drawRect(W*0.2,H*0.2,W-W*0.4,H-H*0.4);
            this.graphics.endFill();
}
drawRectExt();
drawRectInt();

```

This is the result (and the error?):  
 ![](http://www.enriquepiatti.com/Imagenes/Flash_Graphic_Error.jpg)

Why Flash doesn’t draw the inner box (red) in the middle of the outer box?
