AS3:添加包含 FLVPlayback 的影片剪辑时出现参考错误 1056
我收到一个奇怪的 Flash 错误。奇怪的是,只有当我在本地 Flash Player 中打开 .swf 并转到“查看 > 全屏”时,才会出现这种情况。在浏览器中,或者在常规大小的 Flash Player 中,一切都运行良好。
我有一个名为 video_button_01 的按钮(实际上是视频按钮 01 到 04),它调用一个名为 openPopups 的函数。这会向舞台添加一个名为 video_popup_01 的影片剪辑。 video_popup_01 其中包含名为 video_01 的 FLVPlayback 组件的实例。 video_01 是 video_popup_01 时间线的正常部分,不是通过 Actionscript 添加的,并且存在于 video_popup_01 的第 1 帧上。
当我单击 video_button_01 时,出现以下错误:
ReferenceError: Error #1056: Cannot create property video_01 on flash.display.Stage。
我没有使用类文件;我读过有关当舞台上的某些内容未在类文件中声明时发生的问题?但我在发布设置中选中了“自动声明阶段实例”。 http://blog.andrewpaulsimmons.com/2007/ 07/referenceerror-error-1056-caused-by.html
非常感谢您的帮助。
function openPopups (evt:MouseEvent):void {
if (evt.target == video_button_01) {
popup_container.addChild(video_popup_01);
video_popup_01.gotoAndPlay(1);
}
else if (evt.target == video_button_02) {
popup_container.addChild(video_popup_02);
video_popup_02.gotoAndPlay(1);
}
else if (evt.target == video_button_03) {
popup_container.addChild(video_popup_03);
video_popup_03.gotoAndPlay(1);
}
else if (evt.target == video_button_04) {
popup_container.addChild(video_popup_04);
video_popup_04.gotoAndPlay(1);
}
}
video_button_01.addEventListener(MouseEvent.CLICK, openPopups);
I am getting a weird Flash error. The weird thing about it is that it -only- occurs when I open the .swf in the local Flash Player and go to "View > Full Screen". In the browser, or in the Flash Player at regular size, everything works perfectly.
I have a button called video_button_01 (actually, video buttons 01 through 04), which calls a function called openPopups. This adds to the stage a movie clip called video_popup_01. video_popup_01 contains within it an instance of an FLVPlayback component called video_01. video_01 is a normal part of video_popup_01's timeline, is not added via Actionscript, and exists on frame 1 of video_popup_01.
When I click on video_button_01, I get this error:
ReferenceError: Error #1056: Cannot create property video_01 on flash.display.Stage.
I am not using a class file; I've read about this problem occurring when something on the stage is not declared in the class file? But I have "Automatically declare stage instances" checked in my publish settings.
http://blog.andrewpaulsimmons.com/2007/07/referenceerror-error-1056-caused-by.html
Your help is much appreciated.
function openPopups (evt:MouseEvent):void {
if (evt.target == video_button_01) {
popup_container.addChild(video_popup_01);
video_popup_01.gotoAndPlay(1);
}
else if (evt.target == video_button_02) {
popup_container.addChild(video_popup_02);
video_popup_02.gotoAndPlay(1);
}
else if (evt.target == video_button_03) {
popup_container.addChild(video_popup_03);
video_popup_03.gotoAndPlay(1);
}
else if (evt.target == video_button_04) {
popup_container.addChild(video_popup_04);
video_popup_04.gotoAndPlay(1);
}
}
video_button_01.addEventListener(MouseEvent.CLICK, openPopups);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论