views:

612

answers:

1

The movieclip is in a seperate swf file that has been imported into the library. The movieclip itself plays fine (the movieclip is vector based) but when I try and capture the current frame from it into a bitmapdata object nothing seems to happen. I'm wondering if it's some type of security issue?

mc is the movieclip
bitmap=new BitmapData(mc.width,mc.height,false);
trace("Creating bitmap for frame grab width=",mc.width,"height=",mc.height);
bitmap.floodFill(0,0,0xff0000);  //for debugging only
bitmap.draw(mc);

After using the code above to capture the current frame of the movie the texture is solid red so it seems that it is not being changed after the floodfill command I put above for debugging.

A: 

Figured it out, the image is being drawn but is off the right of the screen since it seems to be using some sort of centerpoint or offset position to draw the movie. If I allocate the bitmap to be 4x taller and 4x wider then I see the bitmap.

KPexEA
you can use a matrix (the 2nd argument of draw(DO, matrix)) together with DisplayObject.getBounds() to translate the origin of the sprite beeing drawn... scale and rotation are a bit trickier (the transform object might help)
Cay