Skip to main content
Known Participant
July 5, 2013
Answered

How to use PrintJob.addPage method to print movieclips on frames?

  • July 5, 2013
  • 1 reply
  • 1554 views

Hello,

I am using Flash CS3, AS2.

I am trying to print the movieclips placed on different frames in the main timeline.

Firstly, I want to print the movieclip placed on the frame 172, then print a movieclip placed on the frame 179 and so on...

I have applied the code shown below to the on (release) event of a button named btnPrint:

var my_pj:PrintJob = new PrintJob();

if (my_pj.start()) {

  var pageAdded:Boolean = false;

  pageAdded = my_pj.addPage(0, {xMin:394, xMax:1033, yMin:46, yMax:953}, null, 172);

  if (pageAdded) {

   my_pj.send();
  }
}

I am having 2 problems with the code shown above.

Firstly, when I click the btnPrint button in my flash movie in the web browser, then press the print button on the printer dialog window, it can print the movieclip placed on the frame 172 but the flash movie in my web browser goes to the frame 172 and stops there. I don't want my flash movie to actually go to the frame 172 where the movieclip is placed but I want it to stay at the current frame.

The second problem is, the flash movieclip placed on the frame 172 has actionscript code in it, which sets the text in the textbox inside the movieclip to the variable value which has been retrieved using the loadVariablesNum() method. However the printed out page shows the movieclip with none of the actionscript code executed - the textboxes are blank. I'm sure that the actionscript codes in the movieclip is correct because exactly same movieclip placed on the current frame displays the textbox correctly.

Can somebody explain to me how to sove these problems?

Thank you.

This topic has been closed for replies.
Correct answer kglad

do you see a problem at http://www.kglad.com/Files/forums/test4.html?

1 reply

kglad
Community Expert
Community Expert
July 5, 2013

that code wouldn't cause your timeline to got to frame 172.

there's something else causing that.

ZKM128Author
Known Participant
July 6, 2013

Thank you for your help.

I have tried the same code again by creating a new blank flash movie and only putting a btnPrint button on frame 1 and a graphic on frame 172.

When I pressed the btnPrint button in the web browser, I could get the correct printed out image, but, once again, the web browser shows the printed image on the browser window and not the current frame at which the btnPrint button is located.

Maybe the web browser is simply showing the printed image rather than the flash movie actually going to the frame 172... I have no idea what's going on.

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 6, 2013