![MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual Download Page 598](http://html1.mh-extra.com/html/macromedia/flash-mx-2004-actionscript/flash-mx-2004-actionscript_reference-manual_3378897598.webp)
598
Chapter 12: ActionScript Dictionary
If this method returns
false
(for example, if you haven’t 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 haven’t 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))
{
pa+;
// 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}))
{
pa+;
// 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))
{
pa+;
// 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))
{
pa+;
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...