Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Been workout with Flash? I have a common problem here. Find on Internet but not succeed. In my swf, it appear button Print and display an image which select by public. When public click Print, it will print the image which display on swf. Right now, it can print, but the dialog appear and able to print only 1 image. Second image will failed. Below are my code for print:

<pre lang="cs">stop();

import flash.printing.PrintJob;
//import flash.display.Sprite;

btn_print.addEventListener(MouseEvent.CLICK, btn_printCLICK);

function btn_printCLICK(e:MouseEvent):void{
    printFunction(currentFrame);
}

var myPrintJob:PrintJob = new PrintJob();

function printFunction(n:int):void{
    var originalWidth:Number;
    var originalHeight:Number;

 if (myPrintJob.start()) {
    switch(n){
        case 1:(mc_container_11); break;
        case 2:(mc_container_12); break;
        case 3:(mc_container_13); break;
        default: trace(n); break;
    }
    myPrintJob.addPage(this);
    myPrintJob.send();
 }
};

myPrintJob = null;

/*
var pj:PrintJob = new PrintJob();
var started:Boolean = pj.start2(null, false);
if(started)
{
     pj.addPage(this);
     pj.send();
};
pj = null;


What is wrong with this code?can someone teach me..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900