View Full Version : copypixels not copying

03-01-2009, 09:13 PM
I am trying to copy an image which is in my library. the problem is .... it is not copied when the image remains in the library. But when i drag the image to the stage then it is copied fine. How can i do it without dragging the image to the stage?

here is the code...

this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
var one:BitmapData = BitmapData.loadBitmap("toon");

var renderBuffer:BitmapData = new BitmapData(225, 325);
this.attachBitmap(renderBuffer, this.getNextHighestDepth());
renderBuffer.copyPixels(one, new Rectangle(20, 20, 20, 20), new Point(40,40));