# Draw background problem

**URL:** <https://forum.kirupa.com/t/draw-background-problem/223595>\
**Category:** flash\
**Created:** [April 24, 2007, 5:01am UTC](https://forum.kirupa.com/t/draw-background-problem/223595 "2007-04-24T05:01:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnPopes](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JohnPopes](https://forum.kirupa.com/u/JohnPopes)\
**Post date:** [April 24, 2007, 5:01am UTC](https://forum.kirupa.com/t/draw-background-problem/223595/1 "2007-04-24T05:01:58Z")

</div>

hey i want to have a background grid so i came up with this:

```auto
this.createEmptyMovieClip("bg", 9999);
bg._visible = true;
var startHeight:Number = 4;
var startWidth:Number = 4;
function drawBG() {
 //bg.beginFill(0xffffff, 0);
 bg.lineStyle(1, 0x0F0F0F, 100);
 bg.moveTo(0, startHeight);
 bg.lineTo(Stage.width, startHeight);
 startHeight = startHeight+4;
 bg.endFill();
 if (startHeight>=Stage.height) {
  clearInterval(drawBGInterval);
  drawBGInterval = setInterval(drawBGvertical, 1);
 }
}
function drawBGvertical() {
 //bg.beginFill(0xffffff, 0);
 bg.lineStyle(1, 0x0F0F0F, 100);
 bg.moveTo(startWidth, 0);
 bg.lineTo(startWidth, Stage.height);
 startWidth = startWidth+4;
 bg.endFill();
 if (startWidth>=Stage.width) {
  
  clearInterval(drawBGInterval);
  bg._visible = true;
 }
}
drawBGInterval = setInterval(drawBG, 1);

```

it does what i want but isnt efficient… any thoughts? i dont mind losing the draw thing it can just appear.Another thing, it has to appear behind everything and must be redrawn everytime someone resizes the stage…  
i would really appreciate some help 😑
