Hey all!
ok back at another issues in as3 printing :yikes:
I cant seem to find anything thats really helpful with this. When i click cancel on the print dialog box, i get error below and it blanks out my swf. :scared:Code:
//Function to print entire screen
function printFunction(event:MouseEvent):void
{
var myPrintJob:PrintJob = new PrintJob();
var oldScaleX:Number = root.scaleX;
var oldScaleY:Number = root.scaleY;
//Start the print job
myPrintJob.start();
//Figure out the new scale
var newScaleX:Number = myPrintJob.paperWidth/root.width;
var newScaleY:Number = myPrintJob.paperHeight/root.height;
//Shrink in both the X and Y directions by the same amount (keep the same ratio)
if(newScaleX < newScaleY)
newScaleY = newScaleX;
else
newScaleX = newScaleY;
root.scaleX = newScaleX;
root.scaleY = newScaleY;
//Print the page
myPrintJob.addPage(Sprite(root));
myPrintJob.send();
//Reset the scale to the old values
root.scaleX = oldScaleX;
root.scaleY = oldScaleY;
}
any help is greatly appreciated. ALL I am trying to do is print the entire screen. i dont care at this moment about orientation.
Code:Error #2057: The page could not be added to the print job.
at Error$/throwError()
at flash.printing::PrintJob/addPage()
at designStudiov3_fla::MainTimeline/printFunction()