Pittsburgh Web Development | DVD Authoring Services | Web Hosting    

Pittsburgh Web Development | DVD Authoring Services
 
Contact Me
 
 
Action Script - Printing Directly from Flash

This is a frame script. Make sure your print button is called "PrintButton". Using the x and y, min and max values you can specify which part of the interface to print. This comes in handy if you want to create a printer friendly version of the document off stage. The last number, 1 in this case, is the frame to be printed.

this.PrintButton.onRelease = function () {
    var pj = new PrintJob();
    var success = pj.start();
    if(success) {
        pj.addPage (0,{xMin:0, xMax:800, yMin:0, yMax:600}, {printAsBitmap:true}, 1);
        pj.send();
    }
    delete pj;
}