Debes meter los bitmaps a un contenedor antes de bitmapdata.draw. Ahí te va un ejemplo:
Código ActionScript :
package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Loader;
import flash.geom.Matrix;
public class Prueba2bitmaps extends Sprite
{
private var loader1:Loader=new Loader();
private var loader2:Loader=new Loader();
private var container:Sprite=new Sprite();
public function Prueba2bitmaps()
{
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, cargaBmp1);
var url:URLRequest = new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg");
loader1.load(url);
}
private function cargaBmp1(e:Event):void
{
trace("cqrgado")
var bmp1:Bitmap=loader1.content as Bitmap;
container.addChild(bmp1);
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, cargaBmp2);
var url:URLRequest = new URLRequest("http://www.helpexamples.com/flash/images/image2.jpg");
loader2.load(url);
}
private function cargaBmp2(e:Event):void
{
trace ("cargado 2")
var bmp2:Bitmap=loader2.content as Bitmap;
bmp2.x=400;
container.addChild(bmp2);
var bmd:BitmapData = new BitmapData(800,267,true, 0x00000000);
bmd.draw(container)
var bmpFinal:Bitmap=new Bitmap(bmd);
bmpFinal.scaleX=bmpFinal.scaleY=0.3;
addChild(bmpFinal);
}
}
}
Ten cuidado además con los rollos de seguridad de adobe:
adobe escribió:
Note: The source object and (in the case of a Sprite or MovieClip object) all of its child objects must come from the same domain as the caller, or must be in a SWF file that is accessible to the caller by having called the Security.allowDomain() method. If these conditions are not met, the draw() method does not draw anything.
¡No dibuja nada y no te avisa!