• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Printing without dialog box

Participant ,
Mar 14, 2017 Mar 14, 2017

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 191061: 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

Views

287

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 14, 2017 Mar 14, 2017

you must be publishing an air project to use start2().

Votes

Translate

Translate
Community Expert ,
Mar 14, 2017 Mar 14, 2017

Copy link to clipboard

Copied

you must be publishing an air project to use start2().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 14, 2017 Mar 14, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 14, 2017 Mar 14, 2017

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines