1 Reply Latest reply on Aug 28, 2007 5:03 AM by Newsgroup_User

    Printing via actionscript

    Tolk
      Situation:
      Have a frame, on this frame are three movieclips, each movieclip is 600 x 600 (pixels) in original size but have been scaled down on the frame to 60 x 60. Some of the content inside the movieclips is produced dynamically.

      Problem:
      How can i make a function to print the three movieclips on an individual page of paper each? I also want the movieclips to be printed in there original size / full page size (whichever is easier) rather than the 60 x 60 they are displayed as.

      Thanks to anyone who can help.
        • 1. Re: Printing via actionscript
          Level 7
          Tolk,

          > How can i make a function to print the three movieclips
          > on an individual page of paper each? I also want the
          > movieclips to be printed in there original size / full page
          > size (whichever is easier) rather than the 60 x 60 they
          > are displayed as.

          Check out the PrintJob class. You'll find a good bit of sample code in
          the ActionScript 2.0 Language Reference itself, but here's an article that
          may be a bit easier to get into at first:

          http://www.actionscript.org/resources/articles/206/1/The-PrintJob-class/Page1.html

          The author even mentions a bit about scaling, which you'll have to do if
          you want to print your movie clips at a size larger than the 60 x 60 they
          currently show as. To resize your movie clips, you'll have to refer to them
          by instance name (see the Property inspector as you select each clip to see
          where you can supply an instance name), then invoke MovieClip._width and
          _height or MovieClip._xscale and _yscale as appropriate on each clip before
          invoking the PrintJob.addPage() method, then scale them back afterward.
          This action isn't visible on the screen, which is nice. The
          PrintJob.addPage() method entry of the ActionScript 2.0 Language Reference
          actually demonstrates the scaling part.

          If you're using ActionScript 3.0, which would require Flash CS3, you'll
          find that the AS3 version of PrintJob acts pretty much the same, but you'll
          have to dig into the ActionScript 3.0 Language Reference to examine the
          differences in syntax.


          David Stiller
          Co-author, Foundation Flash CS3 for Designers
          http://tinyurl.com/2k29mj
          "Luck is the residue of good design."