Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 491

Programming actionscript 3.0
Table of Contents

Advertisement

If Flash Player encounters a problem sending the print job to the printer (for example, if the
printer is offline), you can catch that exception, too, and provide the user (or Flash Player)
with information or more options (such as displaying message text or providing an alert
within the Flash animation). For example, you can assign new text to a text field in an
statement, as the following code shows:
if..else
if (myPrintJob.start())
{
try
{
myPrintJob.addPage([params]);
}
catch (e:Error)
{
// Handle error.
}
myPrintJob.send();
}
else
{
myAlert.text = "Print job canceled";
}
For a working example, see
Working with page properties
Once the user clicks OK in Print dialog box and
access the properties defined by the printer's settings. These include the paper width, paper
height (
and
pageHeight
printer settings, not controlled by Flash Player, you cannot alter these settings; however, you
can use them to align the content you send to the printer to match the current settings. For
more information, see
"Example: Scaling, cropping, and responding" on page
), and content orientation on the paper. Because these are
pageWidth
"Setting size, scale, and orientation" on page
returns
PrintJob.start()
493.
Flash Player tasks and system printing
498.
, you can
true
491

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents