FORUMS: list search recent posts

Can't get PrintJob class to actually print.

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
lajoiet
Can't get PrintJob class to actually print.
on Feb 13, 2006 at 7:58:36 pm

Ok, I've got a button (named printBtn) that when clicked I would like to print out a single frame movie clip (named ASPLayout). Here's the code:

printBtn.onRelease = function() {
var pj = new PrintJob();
var success = pj.start();
if(success) {
pj.addPage("ASPLayout", {xMin:-230, xMax:230, yMin:-312,yMax: 312},{printAsBitmap:true},1);
pj.send();
}
delete pj;
}

When I click printBtn, I get the print dialog box, but when I click "Print" nothing gets sent to the printer. I've tried printing to the acrobat print driver, my Laserjet 4000, and my Epson PhotoR300 and get no output with any of them. The Acrobat driver asks me for an output file name, but the file never gets made.

I have the movie clip's linkage identifier set up as ASPLayout.

Any ideas???

I'm filling a need. Without me there would be no bad examples.


Return to posts index

Matt Klundt
Re: Can't get PrintJob class to actually print.
on Feb 13, 2006 at 8:20:16 pm

Have you tried changing "ASPLayout" to something like _root.ASPLayout (no quotes)?

or perhaps just: trace(success);

Matt
--------------------
http://www.mcquillendesign.com
http://www.mattfoxgames.com


Return to posts index

lajoiet
Re: Can't get PrintJob class to actually print.
on Feb 14, 2006 at 1:04:43 am

did the trace(success) bit and got "true", because the line "var success = pj.start();" assigns "true" to "success" when the user selects "Print" from the print dialog box, and assigns "false" if you cancel the print dialog, That's why the addPage and send command only happen when "success" is true. Put traces before the addPage line, after the send() line, and before and after the delete.ph(); line and it hit them all.

"ASPLayout" is not on the timeline anywhere, and the PrintJob class says it doesn't need to be, so _root.ASPLaout would not be valid, but I have tried putting it on the timeline and had no difference. The PrintJob information and the tutorial on it at http://www.actionscripts.org/tutorials/beginner/the_printjob_class/index.sh... makes it clear that the name should be in quotes.

I'm filling a need. Without me there would be no bad examples.


Return to posts index


lajoiet
Re: Can't get PrintJob class to actually print.
on Feb 14, 2006 at 2:32:19 am

OK, I must have done something wrong on my previous attempt with the movie clip on the timeline. Apparently when they say that you can print objects that are "offstage" or "not on the stage" they mean "not on the part of the stage that shows when the document plays.

I removed the linkage ID, placed it on the timeline, but way off of the stage area, and gave it "ASPLayout" as an instance name and it works perfectly...

Thanks for the nudge Matt.

I'm filling a need. Without me there would be no bad examples.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]