flash as3 外部 swf 帮助/错误
我在将外部 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难说是什么导致了空点错误 - 在大多数情况下(加载的 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.