title: Preserving PNG transparency in BitmapData
body: <p>I'm trying to store BitmapData from a MovieClip that is a PNG with transparency. When I <code>copyPixels()</code> the stored BitmapData to the stage bitmap's BitmapData, the transparency has been replaced with solid white.</p>
  
  <p>I've been googling this for over an hour now and trying some things on my own.</p>
  
  <p>Here is the BitmapData storing code:</p>
  
  <pre><code>//for all block types
  for(var block_type_properties in this.block_types)
  {
  
  
      //block_types[i][3] = bitmapdata
      this.block_types[block_type_properties].push(new BitmapData(this.block_size,this.block_size,true,0x000000));
  
      //block_types[i][4] = scale 
      this.block_types[block_type_properties].push(new Number(this.block_size/ this.block_types[block_type_properties][2].width));
  
      //block_types[i][5] = matrix
      this.block_types[block_type_properties].push(this.block_types[block_type_properties][2].transform.matrix);
  
      //scale the matrix
      this.block_types[block_type_properties][5].scale(this.block_types[block_type_properties][4],this.block_types[block_type_properties][4]);
  
      //apply the matrix to the movieclip
      this.block_types[block_type_properties][2].transform.matrix = this.block_types[block_type_properties][5];
  
      //draw the scaled movieclip into the bitmapdata
      this.block_types[block_type_properties][3].draw(this.block_types[block_type_properties][2],this.block_types[block_type_properties][5]);
  
  
  }
  </code></pre>
  
  <p>and here is the part that actually pastes the pixels onto the stage's bitmap:</p>
  
  <pre><code>this.stage_background_bitmap_data.copyPixels(this.block_types[1][3],new Rectangle(0,0,this.block_size,this.block_size),new Point(blocks_array[block_count]['block'].x,blocks_array[block_count]['block'].y));
  </code></pre>
  
  <p>Does anyone have any idea why the transparency in the PNG is being replaced with white?</p>
  
  <h2>Edit:</h2>
  
  <p>These are two lines of code from the constructor:</p>
  
  <pre><code>this.stage_background_bitmap_data = new BitmapData(this.level_width,this.level_height,true,0x00000000);         
  this.stage_background_bitmap = new Bitmap(this.stage_background_bitmap_data);
  </code></pre>
  
  <p>I've ruled out the matrix scaling from being the problem. I removed it and there was no effect on the transparency, or lack thereof.</p>