FLASH PRINT PROBLEM

2007-04-19 6:20 am
i have tried the print method, but only can print the canvas area, can't print the things (example, the snowman head, hand)that the user click and drag on the canvas. anyone can help me fix the problem and send back the fla to my e-mail? i want the user print out the canvas,not whole swf, thx lot..

the fla source: http://www.hkcchome.net/~edgar/fptesting/printtesting.fla
the swf: http://www.hkcchome.net/~edgar/fptesting/printtesting.swf
E_MAIL: [email protected]

回答 (1)

2007-04-19 5:05 pm
✔ 最佳答案
SORRY,呢牌有d忙,所以幫唔到你改,但係我都可以幫手指出個問題所在既

我見你果度都有寫咁多actionscript,咁我當你既actionscript都有一定程度啦,咁等我略略講下啦

首先你用呢行黎print:printAsBitmap(_root.canvas_mc.printarea, ”bmovie”);

你呢度指明要print個”printarea”,姐係個背景,咁所以佢只係print個背景唔奇,因為你冇指明要print埋個雪人既部份嘛

我建議你用PrintJob呢個class,請參考:
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000904.html

當你個影片一開始時就響個root既frame1叫:
var printable:Boolean = false;
var pj:PrintJob = new PrintJob();
printable = pj.start();
if(printable) {
pj.addPage("_root.canvas_mc.printarea", {xMin : -300, xMax: 300, yMin: 400, yMax: 800});
// 請自行調整個printing dimension
// 再用pj.addPage既方法把你所有雪人既部份加到printJob內
pj.send();
}
delete pj;

唔好唔記得每逢你放d雪人部份落個背景度既時候,你要做一個array或之類的,把這些clips都儲起,當print時,你就可以由個array到抽返elements出黎再放落個printjob度啦

留意
pj.send();
可以真接send d資料去個spooler到

當你到最後print完時,記得叫:
delete pj;
咁就可以清除之前所用既memory


收錄日期: 2021-04-23 21:32:43
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070418000051KK04870

檢視 Wayback Machine 備份