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


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

Hi,

Can somebody tell me how I get an embedded image (BitmapAsset) to a useable
BitmapData? I'm a bit confused about this. I want to embed an image and then
use it as a BitmapData object. I got ...


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

private var image:BitmapAsset;

...

image = BitmapAsset(new imageClass());

... but how do I get the BitmapAsset to BitmapData to use the bitmap API on
it? If I try a simple casting I get a Coercion failed.
I would appreciate any help about it! Haven't really delved into this yet!

Thanks,
Sascha

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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