W ell, it's very easy, using bitmapdata and bitmap. this example makes things a bit more complex to show some principles. hope you learn something out of it off course.
// We'll scale the first (background) image by 50% var S: Number =. 5; // create a matrix to make the scalilng of the bitmap possiblevar scalematrix: matrix = new matrix (); // apply the scaling to the matrixscalematrix. scale (S, S); // create a bitmapdata object from an existing Bitmap ("BMP" in this case) var scaledbitmap: bitmapdata = new bitmapdata (BMP. width * s, BMP. height * s, false, 0); // draw the C Ontent and scale it using the matrixscaledbitmap. draw (BMP, scalematrix); // we have an embedded asset called "Flickr", a Flickr logo in GIF formatvar icon: bitmap = new Flickr () as bitmap; // Let's place it in the bottom right cornervar IX: Number = scaledbitmap. width-icon.width; var IJ: Number = scaledbitmap. height-icon.height; // create a matrix for the position of the icon // note the use of the I X and IJ variables in the parametersvar positionmatrix: matrix = new matrix (1, 0, 1, IX, IJ); // draw the icon BMP to the bitmapdatascaledbitmap. draw (icon, positionmatrix); // Add the new, merged, bitmap to your displaylistvar BMP: bitmap = new Bitmap (scaledbitmap); addchild (BMP ); // that's it!
PS: As per user comments I 've also uploaded an example to use in the Flash IDE (*. FLA file)-the above example assumes you're using flash builder or another Editor
I do have to say I don't understand why people try to merge two bitmaps in Flash using the IDE. you coshould just as easily create a movieclip with the two bitmaps on top of each other. or am I missing something? Tell me in the comments!
Download the example *. FLA file here: http://www.webdevotion.be/blog/wp-content/mergy.fla.zip