7 Replies Latest reply on Jul 8, 2013 5:50 AM by kglad

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

    ZKM128 Level 1

      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.