I have an embedded swf that contains a print button which allows users to print some or all pages (AS 2.0) of the swf. The browser's print dialog box opens when the user clicks the print button from the swf. However, after the user clicks print, the swf become blank. This only occurs in IE and FF - works fine in Chrome. Here's the AS2.0 code:
print_btn.onPress = function() {
attachMovie("printbg", "printbg", 5000);
printbg._x = 623;
printbg._y = 360;
attachMovie("printall", "printall", 5001);
printall._x = 621;
printall._y = 316;
attachMovie("printun", "printun", 5002);
printun._x = 622;
printun._y = 342;
attachMovie("printcancel", "printcancel", 5003);
printcancel._x = 622;
printcancel._y = 367;
printcancel.onPress = function() {
removeprint();
};
function removeprint() {
removeMovieClip("printbg");
removeMovieClip("printall");
removeMovieClip("printun");
removeMovieClip("printcancel");
}
printall.onPress = function() {
printallterms();
removeprint();
};
printun.onPress = function() {
printunlearnedterms();
removeprint();
};
};
function printallterms() {
pageno = 0;
toptitle = "<b>"+title+"</b>\nALL\n\n";
attachMovie("printpage_mov", "printall"+pageno, 500);
this["printall"+pageno]._x = 1000;
this["printall"+pageno]._y = 0;
this["printall"+pageno].printtxt.htmlText = toptitle;
for (x=1; x<=20; x++) {
if (this["printall"+pageno].printtxt.textHeight+45>680) {
pageno++;
attachMovie("printpage_mov", "printall"+pageno, 501);
this["printall"+pageno]._x = 1000;
this["printall"+pageno]._y = 0;
this["printall"+pageno].printtxt.htmlText = "";
}
this["printall"+pageno].printtxt.htmlText += "<b>"+term_i[x]+"</b>"+"\n";
this["printall"+pageno].printtxt.htmlText += definition_i[x]+"\n\n";
}
printjobs();
}
function printunlearnedterms() {
pageno = 0;
toptitle = "<b>"+title+"</b>\nREMAINING\n\n";
attachMovie("printpage_mov", "printall"+pageno, this.getNextHighestDepth());
this["printall"+pageno]._x = 1000;
this["printall"+pageno]._y = 0;
this["printall"+pageno].printtxt.htmlText = toptitle;
for (x=1; x<=20; x++) {
if (this["printall"+pageno].printtxt.textHeight+45>680) {
pageno++;
attachMovie("printpage_mov", "printall"+pageno, this.getNextHighestDepth());
this["printall"+pageno]._x = 1000;
this["printall"+pageno]._y = 0;
this["printall"+pageno].printtxt.htmlText = "";
}
if (learned[x] == 0) {
this["printall"+pageno].printtxt.htmlText += "<b>"+term_i[x]+"</b>"+"\n";
this["printall"+pageno].printtxt.htmlText += definition_i[x]+"\n\n";
}
}
printjobs();
}
function printjobs() {
var allprintjob:PrintJob = new PrintJob();
allprintjob.start();
pagesToPrint = 0;
while (pagesToPrint<=pageno) {
allprintjob.addPage(this["printall"+pagesToPrint], {xMin:0, xMax:540, yMin:0, yMax:700});
//trace(this["printall"+pagesToPrint]._height);
removeMovieClip(this["printall"+pagesToPrint]);
pagesToPrint++;
}
if (pagesToPrint>0) {
allprintjob.send();
}
delete allprintjob;
}
Please help!