flash as3 外部 swf 帮助/错误

发布于 2024-09-10 17:43:35 字数 513 浏览 8 评论 0原文

我在将外部 swf 加载到我的 as3 项目中时遇到问题。我已经创建了两个 swf,并且都是使用 as3 创建的。在一个文件中,我尝试加载另一个 swf,仅用于测试目的。它工作正常,但由于某种原因,我收到此错误:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

它工作正常,直到抛出此错误,然后似乎搞砸了。任何可能导致此问题的想法。是否有我缺少做的事情或者我需要做的事情才能使其正确加载。任何帮助表示赞赏。

编辑:

我认为这些信息也可能有帮助。错误中还说:

    at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()

I am having an issue loading an external swf into my as3 project. I have created both swfs and both were creating using as3. In the one file I am trying to load the other swf, just for testing purposes. It works fine but for some reason I am getting this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

It works fine until it throws this error and then it seems to mess up. Any ideas what might be causing this. Is there something I am missing doing or something that I need to do in order to get it to load properly. Any help is appreciated.

EDIT:

I thought this information might be helpful too. In the error it also says:

    at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()

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

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

发布评论

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

评论(1

若言繁花未落 2024-09-17 17:43:35

很难说是什么导致了空点错误 - 在大多数情况下(加载的 SWF 抛出 1009),这是由于从加载的 SWF 的构造函数访问 stage - stage将为空,直到您将对象添加到显示列表。

您发布的错误声明看起来不完整;其中至少缺少一行,这是重要的一行 - 它传达了代码中错误的位置。在加载的 SWF 中发布任何计时器处理代码,我们也许能够查明错误的根源。

It is hard to say what's causing null point error - in most cases like this (loaded SWF throwing 1009), it is due to accessing stage from the loaded SWF's constructor - stage will be null until you add the object to the display list.

The error statement you posted doesn't look complete; there's at least one line missing in it, and that's the important line - it conveys the location of error in your code. Post any timer handling code in the loaded SWF and we might be able to pinpoint the origin of error.

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