-
AS3 Printing help
Hey all!
ok back at another issues in as3 printing
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;
}
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.
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()
NO *****ASSNESS AROUND ME!!!!
-
NO *****ASSNESS AROUND ME!!!!
-
Senior Member
- The right of the People to create Flash movies shall not be infringed. -
-
no... my page isnt a Sprite. How would i make it so? is that the reason why i am having trouble with the cancel button?
NO *****ASSNESS AROUND ME!!!!
-
I need help badly, i am having this exact same issue, does anyone knows whats happening?
-
please has anybody accomplished this?
-
Senior Member
Change myPrintJob.addPage(Sprite(root)); to myPrintJob.addPage(MovieClip(root));
- The right of the People to create Flash movies shall not be infringed. -
-
Originally Posted by cancerinform
Change myPrintJob.addPage(Sprite(root)); to myPrintJob.addPage(MovieClip(root));
Hi thanks for your reply, being really desperate about this.
Well i try that, and it drew another movie clip, and blanked out my main video.
i'm having a problem, where i developed an app that uses the webcam, adds an image and then takes a picture, well, i implemented textbook style the printjob, and well everytime after printing my swf goes blank.
http://stackoverflow.com/questions/3...rint-or-cancel
But now i have been continuing testing, and i found out, that if i print from another application and then comeback, my video stream from the webcam is blank, this has no sense at all, since i am printing from another app.
What is going on here i mean, this must be a flash player issue right.
I need help badly with this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|