User Guide
392 Chapter 6: ActionScript Core Classes
Parameters
target
A number or string; the level or instance name of the movie clip to print. Pass a number
to specify a level (for example, 0 is the
_root movie), or a string (in quotation marks [""]) to
specify the instance name of a movie clip.
printArea An optional object that specifies the area to print, in the following format:
{xMin:topLeft, xMax:topRight, yMin:bottomLeft, yMax:bottomRight}
The coordinates you specify for printArea represent screen pixels relative to the registration
point of the
_root movie clip (if target = 0) or of the level or movie clip specified by target.
You must provide all four coordinates. The width (
xMax-xMin) and height (yMax-yMin) must
each be greater than 0.
Points are print units of measurement, and pixels are screen units of measurement; points are a
fixed physical size (1/72 inch), but the size of a pixel depends on the resolution of the particular
screen. You can use the following equivalencies to convert inches or centimeters to twips or points
(a twip is 1/20 of a point):
• 1 point = 1/72 inch = 20 twips
• 1 inch = 72 points = 1440 twips
• 1 cm = 567 twips
You can’t reliably convert between pixels and points; the conversion rate depends on the screen
and its resolution. If the screen is set to display 72 pixels per inch, for example, one point is equal
to one pixel.
If you omit the
printArea parameter, or if it is passed incorrectly, the full Flex screen area of
target is printed. If you don’t want to specify a value for printArea but want to specify a value
for
options or frameNumber, pass null for printArea.
options An optional parameter that specifies whether to print as vector or bitmap, in the
following format:
{printAsBitmap:Boolean}
The default value is false, which represents a request for vector printing. To print target as a
bitmap, pass
true for printAsBitmap. Remember the following suggestions when determining
which value to use:
• If the content that you’re printing includes a bitmap image, use {printAsBitmap:true} to
include any transparency and color effects.
• If the content does not include bitmap images, omit this parameter or use
{printAsBitmap:false} to print the content in higher quality vector format.
If
options is omitted or is passed incorrectly, vector printing is used. If you don’t want to specify
a value for
options but want to specify a value for frameNumber, pass null for options.
frameNumber An optional number that is used in the Flash authoring environment. When
writing Flex applications, you should omit this parameter or pass a value of 0.