Copy link to clipboard
Copied
Hi,
I'm making a maths learning app for kids using AS3. I have a page with a certificate and want to make a button which prints to the default printer with no printer dialog box.
The code I have;
pLvl1Print.addEventListener(MouseEvent.CLICK, printContent);
function printContent(evt: MouseEvent) {
var pj: PrintJob = new PrintJob();
var started = pj.start2(null, false);
if (started) {
pj.addPage(content_mc);
pj.send();
};
pj = null;
}
The error I get:
plusLvl1Cert, Layer 'actions', Frame 80, Line 7, Column 19 | 1061: Call to a possibly undefined method start2 through a reference with static type flash.printing:PrintJob. |
The problem line of code is in bold.
Can anyone point me in the right direction? The other post's I've found don't seem helpful to me.
Thanks
Jack
you must be publishing an air project to use start2().
Copy link to clipboard
Copied
you must be publishing an air project to use start2().
Copy link to clipboard
Copied
Ah thanks. I'll stick with the dialog box appearing - I've just seen your post on another thread saying it's not possible.
Thanks again,
Jack
Copy link to clipboard
Copied
you're welcome.