1 Reply Latest reply on Oct 14, 2008 9:58 PM by kglad

    addPage in PrintJob

    2008Chris
      I am creating pages with Dynamic data. I do not know how many pages will be printed until the query parameters are selected by the user.

      I am using the PrintJob() process.

      I create a movie per page using createEmptyMovieClip()

      I then format the page with the selected data and based on the amount of data selected, I create additional movies and lay out the data as necessary until all the data is setup for display.

      The layout is created by looping through the query results and it impossible to be sure how many pages will be needed. The process of creating the movies and formatting the data works fine.

      I am having trouble with the addPage process. I created a loop to add the pages, it works, if there is one page but the process crashes if there is more than 1 page.

      This is the code:

      for (l=1; l<(PageCount+1); ++l) {
      eval("print"+l+"_mc").createTextField("Pg_txt",eval("print"+l+"_mc").getNextHighestDepth() ,80,750,65,20);
      eval("print"+l+"_mc").Pg_txt.text = "Page:";
      eval("print"+l+"_mc").Pg_txt.setTextFormat(Title3_fmt);
      eval("print"+l+"_mc").createTextField("Page_txt",eval("print"+l+"_mc").getNextHighestDepth (),120,750,40,20);
      eval("print"+l+"_mc").Page_txt.text = PageCount;
      eval("print"+l+"_mc").Page_txt.setTextFormat(detail_fmt);
      my_pj.addPage("print"+l+"_mc");
      pagesToPrint++;
      }
      if (pagesToPrint>0) {
      my_pj.send();// print page(s)
      }

      HELP!!!!

      please