User Guide

375
CHAPTER 18
Printing from SWF Files
You can add printing functionality to your Macromedia Flash MX 2004 and Macromedia
Flash MX Professional 2004 document that lets users print from Flash Player. You can use
the ActionScript PrintJob class, or you can use the
print() or printAsBitmap() ActionScript
functions. Users can also access the Flash Player context menu and select the Print command
there.
Additionally, users can print from a browser, rather than from Flash Player, by selecting a
command such as File > Print from the browser window. However, printing from Flash Player
directly, rather than from a browser window Print menu, offers several advantages, including
the following:
Users can print all frames or certain frames that youve labeled as printable from Flash Player.
Additionally, you can set the print area of a frame.
You can specify that content print as vector graphics (to take advantage of higher resolution) or
as bitmaps (to preserve transparency and color effects).
The ActionScript PrintJob object improves upon the print() and printAsBitmap()
functions by adding the ability to print dynamically rendered pages as a single print job. The
PrintJob object also provides the user’s printer settings, which can be used to format reports
specifically for the user. See “Using the ActionScript PrintJob class” on page 376.
Flash Player versions earlier than 4.0.25 (Windows) or 4.0.20 (Macintosh) do not support
printing frames directly. Flash Player 7 and later supports the PrintJob class.
This chapter contains the following sections:
Controlling printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Using the ActionScript PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Building a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Starting a print job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Printing frames independent of the PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Changing the printed background color. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Using frame labels to disable printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384