打印期间出错

发布于 2024-11-30 12:50:37 字数 1697 浏览 1 评论 0原文

有三个公共变量

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]

需要帮助......

                } 

There are a three public variable

public var objPrintJob:FlexPrintJob;
public var objPrintTemplate:canvas;

Fn1:

objPrintJob = new FlexPrintJob();
if (objPrintJob.start() != true)
{
        printCount--;
        return;
}

Starting the PrintJob;

Fn2:

Am adding the Object and calling send for the Print

objPrintJob.addObject(objPrintTemplate, FlexPrintJobScaleType.SHOW_ALL);
objPrintJob.send();

During Run

It Throws the Error:

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]

Need Help For This..

                } 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅浅淡淡 2024-12-07 12:50:37

这必须是您的 objPrintTemplate 对象为 null。错误中的堆栈跟踪显示它在 FlexPrintJob/addObject() 中出错,这意味着它已进入该方法,但未完成该方法的执行。由于您发送给它的唯一参数是对象引用和常量值,因此该对象必须为 null。

This has to be that your objPrintTemplate object is null. The stack trace in your error shows that it's erroring in FlexPrintJob/addObject(), which means it made it into that method but did not complete executing the method. Since the only parameters you're sending to it are your object reference and a constant value, the object must be null.

忆伤 2024-12-07 12:50:37

在您的支持下,我找到了解决方案。
谢谢大家。

该对象似乎不为空。
我犯了一个错误,那就是我没有在其他地方添加该对象作为子对象。
所以 print 中的 addObject() 需要 systemManager。
如果我没有作为孩子添加,它将为空。

感谢您的支持

After your support I found out my solution.
Thank U all.

The object does not seems to be null.
I did one mistake that is i didn't added the object as a child anywhere else.
so the addObject() in print requires the systemManager.
which will be null if i didn't add as a child.

Thank You for your support

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文