596 Chapter 12: ActionScript Dictionary
Description
Constructor; creates a PrintJob object that you can use to print one or more pages.
To implement a print job, use these methods in the sequence shown:
// create PrintJob object
my_pj = new PrintJob(); // instantiate object
// display print dialog box
my_pj.start(); // initiate print job
// add specified area to print job
// repeat once for each page to be printed
my_pj.addPage([params]); // send page(s) to spooler
my_pj.addPage([params]);
my_pj.addPage([params]);
my_pj.addPage([params]);
// send pages from the spooler to the printer
my_pj.send(); // print page(s)
// clean up
delete my_pj; // delete object
In your own implementation of PrintJob objects, you should check for return values from
PrintJob.start() and PrintJob.addPage() before continuing to print. See the examples for
PrintJob.addPage().
You cannot create a PrintJob object until any PrintJob object that you already created is no longer
active (that is, it either completed successfully or failed). If you try to create a second PrintJob
object (by calling
new PrintJob()) while the first PrintJob object is still active, the second
PrintJob object will not be created.
Example
See PrintJob.addPage().
See also
PrintJob.addPage()
, PrintJob.send(), PrintJob.start()
PrintJob.addPage()
Availability
Flash Player 7.
Usage
my_pj.addPage(target [, printArea] [, options ] [, frameNumber])
Parameters
target
The level or instance name of the movie clip to print. Pass a number to specify a level
(for example, 0 is the _root movie), or a string (in quotation marks) to specify the instance name
of a movie clip.
printArea An optional object that specifies the area to print, in the following format:
{xMin:topLeft, xMax:topRight, yMin:bottomLeft, yMax:bottomRight}