|
-
[RESOLVED] Printing a specific movieclip
Hi! I have a swf with multiple movieclips on the stage. The user interaction involves adding images to one of the movieclips (the one outlined in red in the image below). I would like the user to then be able to print the movieclip that they were adding images to...NOT the whole stage.
I can kind of do this by specifying the print area, but I would rather not do this as it also prints some overlapping images (see image below).
I thought I remembered there being a way in AS2 to just print one of the movieclips on the stage, but I can't figure out how to do it in AS3.
Thanks for any help.
-
Senior Member
When you use addPage you enter only the name of the MovieClip.
var pj:PrintJob = new PrintJob();
pj.addPage(mc);
pj.send();
- The right of the People to create Flash movies shall not be infringed. -
-
Thanks cancerinform, I have actually tried that before, and it won't let me pass the movieclip like that (I guess it has to be a Sprite?). I get the following error when I try to do that:
Error #2057: The page could not be added to the print job.
at Error$/throwError()
at flash.printing::PrintJob/addPage()
This was the code I had tried:
PHP Code:
function printGirl (e:MouseEvent):void {
var pj:PrintJob = new PrintJob();
pj.addPage(mainStage_mc);
pj.send();
}
print_btn.addEventListener(MouseEvent.CLICK, printGirl);
I have also tried this code, and it prints a blank page and the mainStage_mc movieclip disappears from the stage:
PHP Code:
function printGirl (e:MouseEvent):void {
var myPrintJob:PrintJob = new PrintJob();
var mySprite:Sprite = new Sprite();
mySprite.addChild(mainStage_mc);
myPrintJob.start();
var myOptions:PrintJobOptions = new PrintJobOptions();
myOptions.printAsBitmap = true;
myPrintJob.addPage(mySprite, null, myOptions);
myPrintJob.send();
}
Thanks again for any help!
-
Senior Member
You need to add start:
var pj:PrintJob = new PrintJob();
pj.start();
pj.addPage(mainStage_mc);
pj.send();
- The right of the People to create Flash movies shall not be infringed. -
-
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
|