ThePetest
ThePetest

Reputation: 622

How to attach Bitmaps to a MovieClip in AS3?

I have a bunch of Bitmaps stored in the library and I want to display some of them on the stage via actionscript. All I need is to attach each of them to a MovieClip and use addChild() on the stage. Also I want to be able change the attached bitmaps dynamically.

What is the easiest way to do this?

Upvotes: 1

Views: 3733

Answers (1)

Plastic Sturgeon
Plastic Sturgeon

Reputation: 12527

var myBitmap:Bitmap = new Bitmap(new LibraryBitmapInstance(null, null));
// Add
myMovieclip.addChild(myBitmap);
// remove
myMovieclip.removeChild(myBitmap);

Upvotes: 2

Related Questions