2 Replies Latest reply on Sep 10, 2009 11:57 AM by Ron Colmen

    Movieclips insdie movieclip - Print!!!

    Ron Colmen Level 2

      I'm using:

       

      function PrintFunc(WhatToPrint:Array) {
      var PrintQueue = new PrintJob();
      var PrintStart:Boolean = PrintQueue.start();
      if (PrintStart) {
        for (i=0; i<=WhatToPrint.length; i++) {
        PrintQueue.addPage(WhatToPrint[i]);
        }
        PrintQueue.send();
      }
      }

       

      --------------------------

       

      on (release) {
        PrintFunc([page_mc1],[holder1p]);
      }

       

      Inside my page_mc1 I've got holder1p_mc & holder1bp_mc.

       

      My problem is when I hit PRINT only page_mc1 prints. What should I do to get holder1p_mc & holder1bp_mc too printed as a single page?

        • 1. Re: Movieclips insdie movieclip - Print!!!
          Rothrock Level 5

          You are sending that function two arrays, but the signature is asking for only one. I think the function call should look like this:

           

          PrintFunc([page_mc1,holder1p]);

           

          BTW, not that you asked, but when you come for free help you get what you get...

           

          I would recommend that you move away from using on(event) type coding. It is really old and not the best practice -- unless you are required to publish to Flash 5 or earlier. Here is a great article on the issue:

           

          http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent

           

          The other suggestion I have is to not start your function names with capital letters. If you notice in Flash all functions start with lowercase letters (e.g., gotoAndStop, addPage, etc.).

           

          Classes on the other hand start with caps, for example PrintJob as in new PrintJob() etc.

           

          So when I saw, var PrintStart:Boolean = PrintQueue.start();, my first thought was, "What is this PrintQueue class and what is its static method start() all about?" That might not make sense to you right now, but it would make it easier for others to read your code and understand what is going on.

           

          Just a suggestion.

           

           

          function printFunc(whatToPrint:Array) {
          var printQueue:PrintJob = new PrintJob();
          var printStart:Boolean = printQueue.start();
          if (printStart) {
            for (i=0; i<=whatToPrint.length; i++) {
            printQueue.addPage(whatToPrint[i]);
            }
            printQueue.send();
          }
          }

          • 2. Re: Movieclips insdie movieclip - Print!!!
            Ron Colmen Level 2
            Frame
            function page_mc() {
            var my_pj = new PrintJob();
            var myResult = my_pj.start();
            if (myResult) {
            myResult = my_pj.addPage("my_mc", null, {printAsBitmap:true}, 1);
            my_pj.send();
            delete my_pj;
            }
            }

             

             

            Button
            on(release){
            page_mc();
            }
            JOB DONE!!
            Thanks gbala