title: ActionScript3 - Drawing video(webcam) output on BitmapData with shifted position
body: <p>I'm trying to draw a video(webcam) output on a Bitmapdata, it works if the position of the video is at (0,0) but when I shift the video to (200,0), the drawn output also shifted.</p>
  
  <p>The code is pretty simple</p>
  
  <pre><code>// omitted for brevity
  
  var videoContainer:Sprite = new Sprite();
  
  // Video is added
  videoContainer.addChild(video)
  
  // position is offsetted
  videoContainer.x = 200;
  videoContainer.y = 200;
  this.addChild(videoContainer)
  
  // Generate Bitmap
  var bd:BitmapData = new BitmapData(video.width, video.height, false, 0x0);
  bd.x = video.x;
  bd.y = video.y + video.height;
  this.addChild(bd);
  
  this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
  
  function onEnterFrame(e:Event):void {
      // start drawing
      bd.lock()
      bd.draw(video);
      bd.unlock();
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0dceJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0dceJ.jpg" alt="enter image description here"></a></p>
  
  <p>I've tried to reposition it with a matrix, but apparently the entire original source had changed.</p>
  
  <p>Is there a way to ensure that the output remains at (0,0) even if the videoContainer were offsetted from (0,0)?</p>