title: How do I clear the bitmap each time before blitting?
body: <p>I'm very new to blitting, and I'm still trying to understand the process. In my <code>View</code> object, I have this in my constructor;</p>
  
  <pre><code>this.bcg = new BitmapData(800,600,false,0x000000);
  this.canvas = new Bitmap(bcg);
  </code></pre>
  
  <p>Then I add it to the stage;</p>
  
  <pre><code>addChild(canvas);
  </code></pre>
  
  <p>Then inside my main game loop, I iterate through a nested array to blit copies of <code>rect</code>of type <code>BitmapData</code> objects;</p>
  
  <pre><code>if (array[i][j] !=0) {
          canvas.bitmapData.copyPixels(rect, rect.rect, new Point(i, j));
  }
  </code></pre>
  
  <p>I thought perhaps I could do it by blitting by background back onto <code>canvas</code> before my loop;</p>
  
  <pre><code>canvas.bitmapData.copyPixels(bcg, bcg.rect, new Point(0, 0));
  </code></pre>
  
  <p>But that doesn't work. I've tried searching around for an answer for this, but it's very difficult to find any in-depth information on blitting in AS3.</p>
  
  <p>What I'm trying to do is clear the bitmap of all the pixels I've blitting onto it, and start again with just my background, <code>bcg</code>. I tried doing this before my loop;</p>
  
  <pre><code>this.bcg = new BitmapData(800,600,false,0x000000);
  this.canvas = new Bitmap(bcg);
  </code></pre>
  
  <p>But I ended up with a completely black screen, and none of my <code>rect</code> were being blitted onto <code>canvas</code>.</p>