
538
Printing from SWF Files
To build a print job:
1.
Create an instance of the print job object:
new PrintJob()
.
2.
Start the print job and display the print dialog box for the operating system:
PrintJob.start()
. For more information, see
“Starting a print job” on page 539
.
3.
Add pages to the print job (call once per page to add to the print job):
PrintJob.addPage()
. For more information, see
“Adding pages to a print job”
on page 540
.
4.
Send the print job to the printer:
PrintJob.send()
. For more information, see
“Sending
the print job to the printer” on page 543
.
5.
Delete the print job:
delete PrintJob
. For more information, see
“Deleting the print
job” on page 543
.
The following example shows ActionScript that creates a print job for a button:
myButton.onRelease = function()
{
var my_pj = new PrintJob();
var myResult = my_pj.start();
if(myResult){
myResult = my_pj.addPage (0, {xMin : 0, xMax: 400, yMin: 0,
yMax: 400});
myResult = my_pj.addPage ("myMovieClip", {xMin : 0, xMax: 400,
yMin: 400, yMax: 800},{printAsBitmap:true}, 1);
myResult = my_pj.addPage (1, null,{printAsBitmap:false}, 2);
myResult = my_pj.addPage (0);
my_pj.send();
}
delete my_pj;
}
Only one print job can run at any given time. A second print job cannot be created until one
of the following events has happened with the previous print job:
■
The print job was entirely successful and
PrintJob.send()
method was called.
■
The PrintJob.start()
method returned a value of
false
.
■
The PrintJob.addPage()
method returned a value of
false
.
■
The delete PrintJob
method has been called.
Содержание FLASH 8-USING FLASH
Страница 1: ...Using Flash...
Страница 12: ...12 Contents...
Страница 110: ...110 Using Symbols Instances and Library Assets...
Страница 128: ...128 Working with Color Strokes and Fills...
Страница 156: ...156 Drawing...
Страница 190: ...190 Working with Text...
Страница 224: ...224 Working with Graphic Objects...
Страница 270: ...270 Creating Motion...
Страница 310: ...310 Working with Video...
Страница 362: ...362 Working with Screens Flash Professional Only...
Страница 386: ...386 Creating Multilanguage Text...
Страница 454: ...454 Data Integration Flash Professional Only...
Страница 500: ...500 Publishing...
Страница 534: ...534 Creating Accessible Content...