Posted By

weavermedia on 06/30/09


Tagged

as3 bitmap


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

weavermedia
macKaminski
gandreini


Make Bitmap of a MovieClip (maybe to simplify animation, whatever)


 / Published in: ActionScript 3
 

  1. // source for the bitmap data in this case is a text field
  2. var tf:TextField = new TextField();
  3. tf.text = "bitmap text";
  4.  
  5. // create new transparent BitmapData object to hold the captured data
  6. // BitmapData(width, height, transparent, color)
  7. var myBitmapData:BitmapData = new BitmapData(80, 20, true, 0x000000);
  8.  
  9. // draw the source data into the BitmapData object
  10. myBitmapData.draw(tf);
  11.  
  12. // make a new Bitmap object and populate with the BitmapData object
  13. var bmp:Bitmap = new Bitmap(myBitmapData);
  14.  
  15. // add Bitmap to stage
  16. this.addChild(bmp);

Report this snippet  

You need to login to post a comment.