You don't attach the BitmapData, you have to attach a Bitmap object via the
addChild method. To get the BitmapData onto a movieclip you need to make a
new Bitmap object with the BimapData, of course you could just attach the
original image.

[Embed(source="image.png")] private var imageClass:Class;

private var moveiclip   :MovieClip      = new MovieClip();
private var image               :Bitmap = new imageClass();
private var bitmapData  :BitmapData     = image.bitmapData;
private var newImage    :Bitmap = new Bitmap(bitmapData);

movieclip.addChild(newImage); //Add new bitmap
movieclip.addChild(image); //Add original image

hth
Jim


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sascha
Balkau
Sent: 31 July 2006 03:12
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] AS3 - From BitmapAsset to BitmapData?

Thanks a lot Jim! That was the link I was looking for!

Maybe you can give me a hint on another BitmapData problem: How do I attach
a BitmapData to a MovieClip in AS3? attachBitmap is no more and if I use
addChild I get a Coercion failed again.

Sascha



> When embedding the images like this I use a normal Bitmap class not a
> BitmapAsset. Then you can access the bitmapData property of the bitmap
> class.
> 
> [Embed(source="image.png")] private var imageClass:Class;
> 
> private var image:Bitmap = new imageClass();
> private var bitmapData        :BitmapData     = image.bitmapData;
> 
> hth
> Jim

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to