Question

I got an swf that has SimpleButtons in the stage, and I need to get the bitmap or bitmapdata information from the button states.

When I load the symbol, it seems that no matter what composes the button states, they are all shapes, at least that's what I get in the expression panel.

So, how can I get the bitmap or bmpdata from a Shape?.

Thanks.

Was it helpful?

Solution

You can use BitmapData#draw() to get BitmapData from any DisplayObject. BitmapData is raster, so be aware you will lose features of the vector Shape

var bd:BitmapData = new BitmapData( shape.width, shape.height );
bd.draw( shape );

OTHER TIPS

If you're targeting FP 11.6 I'd use the method graphics.readGraphicsData as explained here http://www.bytearray.org/?paged=6

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top