# Graphics.clear not working

**URL:** <https://forum.kirupa.com/t/graphics-clear-not-working/239137>\
**Category:** Uncategorized\
**Created:** [September 18, 2007, 11:50pm UTC](https://forum.kirupa.com/t/graphics-clear-not-working/239137 "2007-09-18T23:50:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [September 18, 2007, 11:50pm UTC](https://forum.kirupa.com/t/graphics-clear-not-working/239137/1 "2007-09-18T23:50:38Z")

</div>

I have this on the first frame main timeline

```php

function doBar(event:Event) {
    graphics.clear();
    var bar:Shape = new Shape();
    bar.graphics.beginFill(0x000000, 100);
    bar.graphics.lineStyle(0, 0xffffff,100);
    bar.graphics.drawRect(50,stage.height/2,10,150);
    bar.graphics.endFill();
    addChild(bar);
}

this.addEventListener(Event.ENTER_FRAME,doBar);

```

The reason I think its not working is because it starts to go really slow after about 15 seconds…

I also tried bar.graphics.clear() and still didnt work…what am I doing wrong? I want it to draw a new one every time. thanks.
