AS3 MovieClip 不断给我一个 NULL 对象引用
我有一个 Android Air 应用程序,我将 png 图像导入到第二帧的舞台上,并将其转换为动画剪辑的符号。我正在使用此图像作为影片剪辑来执行悬停动画,它效果很好,但是当我从动画所在的第 2 帧开始时,我移动到第 3、4、5 或 6 帧,然后移回帧2、我的应用程序在再次引用影片剪辑时抛出错误。错误是1009无法访问空对象引用。 所以对我来说,一旦时间线远离第 2 帧,它就会消除对转换为影片剪辑的导入图像的引用......这是正确的吗?有没有办法让时间线保持引用此图像作为影片剪辑,以便我可以随时返回到此帧?
谢谢 科学的
I have a Android Air application, where I import a png image to the stage on frame two and converted it to a symbol as a movieclip. I am performing a hovering animation using this image as a movieclip and it works great but when I go from frame 2, where the animation is, and I move to frame 3, 4, 5, or 6, and then I move back to frame 2, my application throws a errors when referencing the movieclip again. The error is 1009 cannot access null object reference.
So to me it seems that once the timeline moves away from frame 2 it wipes away the reference to the imported image converted to a movieclip....is this correct? Is there a way I can keep the timeline referencing the this image as a movieclip so I can always come back to this frame?
thanks
Scientific
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每次停在包含影片剪辑的帧时,您都可以侦听 EXIT_FRAME 事件:
在这个特定的代码片段中,content.products 通常一开始为 null,但在 hdExitFrame 中则不是。
You can listen for the EXIT_FRAME event every time you stop at the frame containing the movie clip:
in this paricular code snip, content.products is usually null at first, but in hdExitFrame, it's not.