[Flashcoders] Two problems with BitmapData.draw() w/r/t registration point and transparency

2008-07-03 Thread jonathan howe
Hi, gang, I have a long list of MovieClips. For each one, I want to create a bitmap icon that shows the first frame. The problems I'm having: 1. The MovieClips often have content above and before (-y and -x) the registration point, and simply performing BitmapData.draw() I don't seem to get the

Re: [Flashcoders] Two problems with BitmapData.draw() w/r/t registration point and transparency

2008-07-03 Thread Ashim D'Silva
I've found you have to set up the bitmapdata to have 4 channels instead of 3 to get transparency. So for a transparent image... new BitmapData(width, height, true, 0x); That should make it truly transparent. And for the first part, I haven't tried it, but have you looked into using a

Re: [Flashcoders] Two problems with BitmapData.draw() w/r/t registration point and transparency

2008-07-03 Thread Rob Romanek
As suggested Matrix will get you there. Here is some sample code: var box1 = new Sprite(); box1.graphics.beginFill(0xff); box1.graphics.drawRect(-10,-10,10,10); box1.graphics.endFill(); box1.graphics.beginFill(0x00ff00); box1.graphics.drawRect(0,0,20,20); box1.graphics.endFill();