0 Replies Latest reply on Feb 19, 2007 3:50 AM by Siriun

    PrintJob weirdness

    Siriun
      I have done various searches on the PrintJob class but could really do with some advice please.

      I have a movie that offers a choice of 3 flyers to print out, so there are 3 initial buttons.

      When a button (say flyer 1) is clicked it loads flyer1.swf into an empty mc with the instance name of flyer.

      Flyer1 has 2 frames: in the first there is an input text field called dateIn_var, in frame 2 there is dynamic text field called dateOut_var. There's a stop(); in frame 1 and the code in frame 2 is: dateOut_var = dateIn_var;

      In the root movie in frame 1 there are the 3 buttons. Also in this frame number is the empty mc flyer.
      My code for loading the flyers is:
      ................
      flyer1_bt.onRelease = function () {
      flyer.loadMovie("flyer1.swf");
      gotoAndStop(5);
      }
      ...............

      This loads my flyer and advances the playhead to frame 5 on the root timeline where I have a print button (print_bt).
      on frame 5 I have this code:
      ................
      print_bt.onRelease = function() {
      flyer.gotoAndStop(5);
      var pj:PrintJob = new PrintJob();
      var success = pj.start();
      if(success)
      {
      pj.addPage(0,{xMin:0, xMax:355, yMin:0, yMax:500}, {printAsBitmap:false}, 5);
      pj.send();
      }
      delete pj;
      }
      .............
      This updates my flash movie's dynamic text field but when I press the button on my computer's print dialog box, I get a print out of my flyer with empty dynamic text fields. The weird thing is that if I do a second print the text fields print out as intended. It seems like the code is stopping the movie before the text fields load initially and then continuing AFTER a print has been made.

      Is there a way to resolve this? I have tried moving the code for my dynamic text to an earlier frame without luck so far.

      (BTW the code below appears after attempting to use the attach code button on Safari...)