Print from Flash using ActionScript. A few requirements. You will need to tell what printer to use, with the start method. The start method will pop the printer selection dialog box
Another requirement for a print job to be sent is to have at least one page. No pages, no printing.
Download complete tutorial, without advertisement, on FLV format with tested source FLA files: $5
For the Adobe Reference on printing, click here
HERE IS THE SOURCE CODE!
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
print_btn.addEventListener(MouseEvent.CLICK, printMe);
function printMe (event:MouseEvent) {
var myPrintJob:PrintJob = new PrintJob();
// this creates a print job
myPrintJob.start();
//This will pop the dialog box
//with printer options
// this is required in order to send
myPrintJob.addPage(circle_mc);
// this will add a page
// the page will contain only the circel
myPrintJob.addPage(this);
// this will add an additional page
// that will show the whole stage
// this means the circle on top of
// the square
myPrintJob.send();
// This will only work if
// print start and at least one page
// was added!!
// thanks for watching !!!
}






32 Responses to “VIDEO: How to Print from Flash Using ActionScript”
Trackbacks/Pingbacks