MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 698

Actionscript language reference
Table of Contents

Advertisement

To implement a print job, use the following methods in sequence. You must place all commands
relating to a specific print job in the same frame, from the constructor through
and delete. Replace the
parameters.
// create PrintJob object
var my_pj:PrintJob = new PrintJob();
// display print dialog box, but only initiate the print job
// if start returns successfully.
if (my_pj.start()) {
// use a variable to track successful calls to addPage
var pagesToPrint:Number = 0;
// add specified area to print job
// repeat once for each page to be printed
if (my_pj.addPage([params])) {
pagesToPrint++;
}
if (my_pj.addPage([params])) {
pagesToPrint++;
}
if (my_pj.addPage([params])) {
pagesToPrint++;
}
// send pages from the spooler to the printer, but only if one or more
// calls to addPage() was successful. You should always check for successful
// calls to start() and addPage() before calling send().
if (pagesToPrint > 0) {
my_pj.send();
}
}
// clean up
delete my_pj;
You cannot create a second PrintJob object while the first one is still active. You cannot create a
second PrintJob object (by calling
the second PrintJob object will not be created.
Example
See PrintJob.addPage().
See also
PrintJob.addPage(), PrintJob.send(),
698
Chapter 2: ActionScript Language Reference
to the
[params]
// print page(s)
// delete object
new PrintJob()
method calls with your custom
my_pj.addPage()
) while the first PrintJob object is still active,
PrintJob.start()
PrintJob.send()

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents