MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1029

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example shows how you might use the value of the orientation property to
adjust the printout:
// create PrintJob object
var my_pj:PrintJob = new PrintJob();
// display print dialog box
if (my_pj.start()) {
// boolean to track whether addPage succeeded, change this to a counter
// if more than one call to addPage is possible
var pageAdded:Boolean = false;
// check the user's printer orientation setting
// and add appropriate print area to print job
if (my_pj.orientation == "portrait") {
// Here, the printArea measurements are appropriate for an 8.5" x 11"
// portrait page.
pageAdded = my_pj.addPage(this,{xMin:0,xMax:600,yMin:0,yMax:800});
}
else {
// my_pj.orientation is "landscape".
// Now, the printArea measurements are appropriate for an 11" x 8.5"
// landscape page.
pageAdded = my_pj.addPage(this,{xMin:0,xMax:750,yMin:0,yMax:600});
}
// send pages from the spooler to the printer
if (pageAdded) {
my_pj.send();
}
}
// clean up
delete my_pj;
See also
addPage (PrintJob.addPage method)
,
send (PrintJob.send method)
PrintJob
1029

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents