Im working on a little project where I need to print images.
The images are externally loaded into the swf by using :
var imgLader:Loader = new Loader();
imgLader.load(new URLRequest("whatEverimage"));
addChild(imgLader);
I have this for my print button
printKnop.addEventListener(MouseEvent.CLICK, printen);
function printen(event:MouseEvent):void {
var pj = new PrintJob();
pj.start();
pj.addPage(imgLader, {xMin:0,xMax:400,yMin:0,yMax:500});//die margins snap ik nog niet....
pj.send();
//delete pj;
}
But flash trows me an error
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@52d52791 to flash.display.Sprite.
at as3kleuterapp_fla::MainTimeline/printen()
Anyone an idea how to fix this ?