EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 598

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
598 Chapter 12: ActionScript Dictionary
If this method returns false (for example, if you havent called PrintJob.start() or the user
canceled the print job), any subsequent calls to
PrintJob.addPage() will fail. However, if prior
calls to
PrintJob.addPage() were successful, the concluding PrintJob.send() command
sends the successfully spooled pages to the printer.
If you passed a value for
printArea, the xMin and yMin coordinates map to the upper left corner
(0,0 coordinates) of the printable area on the page; the printable area is determined by the
pageHeight and pageWidth properties set by PrintJob.start(). Because the printout aligns
with the upper left corner of the printable area on the page, the printout is clipped to the right
and/or bottom if the area defined in
printArea is bigger than the printable area on the page. If
you havent passed a value for
printArea and the Stage is larger than the printable area, the same
type of clipping takes place.
If you want to scale a movie clip before you print it, set its
MovieClip._xscale and
MovieClip._yscale properties before calling this method, then set them back to their original
values afterward. The scale of a movie clip has no relation to
printArea. That is, if you specify
that you print an area that is 50 x 50 pixels in size, 2500 pixels are printed. If you have scaled the
movie clip, the same 2500 pixels are printed, but at the scaled size.
The Flash Player printing feature supports PostScript and non-PostScript printers. Non-
PostScript printers convert vectors to bitmaps.
Example
The following example illustrates several ways to issue the addPage() command.
my_btn.onRelease = function()
{
var pageCount = 0;
var my_pj = new PrintJob();
if (my_pj.start())
{
// Print entire current frame of the _root movie in vector format
if (my_pj.addPage(0))
{
pageCount++;
// Starting at 0,0, print an area 400 pixels wide and 500 pixels high
// of the current frame of the _root movie in vector format
if (my_pj.addPage(0, {xMin:0,xMax:400,yMin:0,yMax:500}))
{
pageCount++;
// Starting at 0,0, print an area 400 pixels wide and 500 pixels high
// of frame 1 of the _root movie in bitmap format
if (my_pj.addPage(0, {xMin:0,xMax:400,yMin:0,yMax:500},
{printAsBitmap:true}, 1))
{
pageCount++;
// Starting 50 pixels to the right of 0,0 and 70 pixels down,
// print an area 500 pixels wide and 600 pixels high
// of frame 4 of level 5 in vector format
if (my_pj.addPage(5, {xMin:50,xMax:550,yMin:70,yMax:670},null, 4))
{
pageCount++;

Table of Contents

Related product manuals