TonoNam
asked on
Convert Bitmap to MoviClip
I have the following code to create a new BitmapData. How could I convert this bitmap to a new MovieClip or Sprite?
var myMatrix:Matrix = new Matrix();
myMatrix.tx=55;
myMatrix.ty=55;
var myBitmapData:BitmapData=ne w BitmapData(400,400,false,0 x009966);
var bm:Bitmap=new Bitmap(myBitmapData);
myBitmapData.draw(b_mc, myMatrix);
AddChild(bm);
var myMatrix:Matrix = new Matrix();
myMatrix.tx=55;
myMatrix.ty=55;
var myBitmapData:BitmapData=ne
var bm:Bitmap=new Bitmap(myBitmapData);
myBitmapData.draw(b_mc, myMatrix);
AddChild(bm);
ASKER
For some reason when I add bm to a movieClip of Sprite it does not work. I can just add bm to the main stage by writing: addChild(bm) but whenever I try to stuff like myMovieClip.addChild(bm) there is an error. Is it iposible to add a bitmap to a MovieClip?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To add it to a new Sprite or MovieClip
mySprite = new Sprite();
mySprite.addChild(bm);
But you probably already knew how to do that. :)