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, 0x00000000);

That should make it truly transparent.

And for the first part, I haven't tried it, but have you looked into
using a Matrix?

2008/7/3 jonathan howe <[EMAIL PROTECTED]>:
> 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 "negative" data
> 2. I'd like transparency on the resultant bitmaps.
>
> Problem #1 I solved in a seemingly complicated way: by creating another
> movieclip, nesting the one I want inside it, and repositioning it based on
> the bounding box.
> Problem #2 I can't seem to decipher the documentation on proper use of
> BlendModes and could really use some guidance.
>
> --------
>    var sample_mc:MovieClip = AssetManager.getMovieClipAsset(classnames[i]);
> // assume this returns a MovieClip instance
>    var sampleParent_spr:Sprite = new Sprite(); // Note I never add it as a
> child to anything
>    sampleParent_spr.addChild(sample_mc);
>    var boundingBox:Rectangle = sample_mc.getBounds(sampleParent_spr);
>    if (boundingBox.x < 0) {
>       sample_mc.x = -boundingBox.x;
>    }
>    if (boundingBox.y < 0) {
>       sample_mc.y = -boundingBox.y;
>    }
>    var bitmapDataCopy:BitmapData = new BitmapData(boundingBox.width,
> boundingBox.height,true); // here I have set transparent to true (although
> it is default!)
>    bitmapDataCopy.draw(sampleParent_spr,null,null,BlendMode.LAYER);  //
> have I selected the correct blendMode? Do I need to change blendMode of
> sampleParent_spr ?
>    // Resultant Bitmap objects made from bitmapDataCopy do not have
> transparent channel.
> --------
>
> Can anyone help me improve #1 or solve #2?
>
> -jonathan
>
>
> --
> -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
Random Lines 3D
My online portfolio
www.therandomlines.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to