Posted By

andrewrench on 04/14/09


Tagged

as2


Versions (?)

BitmapData and movieclip registration


 / Published in: ActionScript
 

URL: http://www.actionscript.org/forums/archive/index.php3/t-139095.html

  1. private function takeSnapshot(picSubject:MovieClip, offSet:Boolean, parentClip:MovieClip) {
  2.  
  3. var bmd:BitmapData = new BitmapData(picSubject._width, picSubject._height, true, 0xFF0000);
  4.  
  5. if (offSet) {
  6. var mat:Matrix = new Matrix();
  7. mat.translate(picSubject._width/2, picSubject._height/2);
  8. bmd.draw(picSubject, mat);
  9. } else {
  10. bmd.draw(picSubject);
  11. }
  12.  
  13. var mc:MovieClip = parentClip.attachMovie("bmdHolder", "bmdHolder", parentClip.getNextHighestDepth());
  14.  
  15. mc.bmdHolderShim._width = picSubject._width;
  16. mc.bmdHolderShim._height = picSubject._height;
  17.  
  18. mc.attachBitmap(bmd, mc.getNextHighestDepth());
  19.  
  20. return mc;
  21.  
  22. }

Report this snippet  

You need to login to post a comment.