Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Issue when creating bitmap from a movie clip in AS3
- import flash.geom.Matrix;
- import flash.display.BitmapData;
- import flash.display.Bitmap;
- var box1:Box = new Box();
- box1.x = 100;
- box1.y = 20;
- addChild( box1 );
- box1.scaleX *= -1;
- var box2:Box = new Box();
- box2.x = 300;
- box2.y = 20;
- addChild( box2 );
- var matrix:Matrix = new Matrix( 1, 0, 0, 1, (box1.width / 2), (box1.height / 2) );
- var bitmapData:BitmapData = new BitmapData( box1.width, box1.height, true, 0xFFFFFF);
- bitmapData.draw(box1, matrix, null, null, null, true);
- var bitmap:Bitmap = new Bitmap( bitmapData );
- addChild( bitmap );
- bitmap.x = 400;
- bitmap.y = 300;
- var myMatrix:Matrix = myDisplayObject.transform.matrix;
- myMatrix.scale(1,-1);
- myDisplayObject.transform.matrix = myMatrix;
- var bitmapData:BitmapData = new BitmapData( box1.width, box1.height, true, 0xFFFFFF);
- bitmapData.draw(box1, myMatrix, null, null, null, true);
- var matrix:Matrix = new Matrix( 1, 0, 0, 1, -(box1.width / 2), (box1.height / 2) );
Add Comment
Please, Sign In to add comment