title: Actionscript Retrieving BitmapData From Sprite Mouse Event
body: <p>i've created a bitmap with data and placed it into a sprite so to receive mouse events.  however, i'm struggling with reading the BitmapData within the sprite.</p>
  
  <pre><code>function showBitmapData(e:Event):void
      {
      var bData:BitmapData = new BitmapData(video.width, video.height);
      bData.draw(video);
  
      var bmap:Bitmap = new Bitmap(bData);
      bmap.x = 220;
      bmap.y = 20;
      bmap.scaleX = bmap.scaleY = 2;
  
      canvas = new Sprite;
      addChild(canvas);
      canvas.addChild(bmap);
  
      //Mouse Track Pixel Colors
      canvas.addEventListener(MouseEvent.CLICK, readPixel);
      }
  
  function readPixel(e:MouseEvent):void
      {
      var hex:uint = e.bmap.bData.getPixel32(mouseX, mouseY); // &lt;- is the problem?
      var pixelAlpha:int = (hex &gt;&gt;&gt; 0x18) &amp; 0xff;
      var red:int = (hex &gt;&gt;&gt; 0x10) &amp; 0xff;
      var green:int = (hex &gt;&gt;&gt; 0x08) &amp; 0xff;
      var blue:int = hex &amp; 0xff;
  
      colorText.text = "Red:" + red + " Green:" + green + " Blue:" + blue + " Alpha:" + pixelAlpha;
      }
  </code></pre>