FLASH CS3
User Guide
459
Note:
Any ActionScript code that needs to be called to change a resulting printout must run before the
PrintJob.addPage()
method is called. The ActionScript can, however, run before or after a new
PrintJob()method
. If a frame has a call to
PrintJob.addPage()
, the call itself does not guarantee that the Action-
Script script on that frame will run when that frame is printed.
Note:
For information on printing from SWF files at runtime using ActionScript 3.0, see “Printing” in Programming
ActionScript 3.0.
Specifying a target
The ActionScript 2.0
target
parameter can be either a number that represents a level (such as 0 for the _root
document), or a string that represents the instance name of a movie clip (
"myMovieClip"
).
Specifying a print area
The optional
printArea
parameter includes the following values:
{xMin:Number, xMax:Number, yMin:Number, yMax:Number}
The
xMin
,
xMax
,
yMin
, and
yMax
values represent screen pixels relative to the target level or movie clip registration
point. The print area orientation is from the upper-left corner of the printable area on the page. If the print area is
larger than the printable area on the page, the print data that exceeds the right and bottom edge of the page is clipped.
A.
Paper rectangle
B.
Page rectangle
C.
(594,774)
D.
(576,756)
E.
(0,0)
F.
(-18,-18)
If you don’t specify a print area, or if you specify an invalid print area, the print area defaults to the Stage area of the
root document.
Scaling, points, and pixels
A print job using the PrintJob class prints Flash content, by default, without scaling it. For example, an object that is
144 pixels wide on screen prints as 144 points, or 2 inches wide.
One point equals one pixel. In the authoring tool, 72 pixels equals one inch; on paper, 72 points equals one inch.
To understand how Flash screen content maps to the printed page, it helps to understand screen and print units of
measure. Pixels are a screen measurement and points are a print measurement. Both pixels and points equal 1/72 of
an inch. A
twip
is 1/20 of a point and pixel.
C
D
F
E
A
B