ActionScript classes > BitmapData (flash.display.BitmapData) > copyPixels (BitmapData.copyPixels method) import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bitmapData_1:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC); var bitmapData_2:BitmapData = new BitmapData(100, 80, false, 0x00FF0000); var mc_1:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth()); mc_1.attachBitmap(bitmapData_1, this.getNextHighestDepth()); var mc_2:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth()); mc_2.attachBitmap(bitmapData_2, this.getNextHighestDepth()); mc_2._x = 101; mc_1.onPress = function() { bitmapData_2.copyPixels(bitmapData_1, new Rectangle(0, 0, 50, 80), new Point(51, 0)); } mc_2.onPress = function() { bitmapData_1.copyPixels(bitmapData_2, new Rectangle(0, 0, 50, 80), new Point(51, 0)); } |