/ Published in: ActionScript 3
Expand |
Embed | Plain Text
public function makeItABitmapMovieClip(dO:DisplayObject):MovieClip { var mc:MovieClip = new MovieClip(); var myBitmapData:BitmapData = new BitmapData(dO.width, dO.height, true, 0x000000); var rect:Rectangle = dO.getBounds(dO); var m:Matrix = new Matrix(); m.tx = -rect.x; m.ty = -rect.y; myBitmapData.draw(dO, m); var bmp:Bitmap = new Bitmap(myBitmapData); bmp.smoothing = true; mc.addChild(bmp); bmp.x = bmp.width/-2; bmp.y = bmp.height/-2; return mc; }
You need to login to post a comment.
