有三個公共變量錯誤在打印
public var objPrintJob:FlexPrintJob;
public var objPrintTemplate:canvas;
Fn1的:
objPrintJob = new FlexPrintJob();
if (objPrintJob.start() != true)
{
printCount--;
return;
}
開始PrintJob的;
Fn2的:
Am adding the Object and calling send for the Print
objPrintJob.addObject(objPrintTemplate, FlexPrintJobScaleType.SHOW_ALL);
objPrintJob.send();
在運行
它拋出的錯誤:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.printing::FlexPrintJob/addObject()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\printing\FlexPrintJob.as:252]
at org.dckap.mafcote.views.mediators::WorkAreaMediator/parseXML()[F:\MafcoteMGP\MafcoteMGP\src\org\dckap\mafcote\views\mediators\WorkAreaMediator.as:3243]
at org.dckap.mafcote.views.mediators::WorkAreaMediator/onSaveTemplateWithCredits()[F:\MafcoteMGP\MafcoteMGP\src\org\dckap\mafcote\views\mediators\WorkAreaMediator.as:2896]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:12266]
at org.dckap.mafcote.views::CreditsShowPanel/okButtonClickHandler()[F:\MafcoteMGP\MafcoteMGP\src\org\dckap\mafcote\views\CreditsShowPanel.mxml:41]
at org.dckap.mafcote.views::CreditsShowPanel/__btnOk_click()[F:\MafcoteMGP\MafcoteMGP\src\org\dckap\mafcote\views\CreditsShowPanel.mxml:159]
需要幫助的..
}
您在提問時應該真正改進您的示例。此外,你從來沒有實例化你的畫布(爲什麼你在Flex 4應用程序中使用canvas?)。 –
我啓動了對象,並且它有一個孩子。 – Exhausted