闪光灯临超链接按钮错误闪光灯、超链接、按钮、错误

由网友(柒)分享简介:我已经创建了使用Flash专业版CC我一直在做研究的一个按钮,但无法找到为什么一个类型错误说明类型错误:错误#1009:无法访问空对象的属性或方法reference.at PD3Subscribenow_fla :: MainTimeline /帧1()我已经把我的code上的动作层的帧1:进口flash.even...

我已经创建了使用Flash专业版CC我一直在做研究的一个按钮,但无法找到为什么一个类型错误说明 类型错误:错误#1009:无法访问空对象的属性或方法reference.at PD3Subscribenow_fla :: MainTimeline /帧1() 我已经把我的code上的动作层的帧1:

 进口flash.events.MouseEvent;
sub_btn.addEventListener(MouseEvent.CLICK,myButtonFunction);
功能myButtonFunction(事件:MouseEvent)方法{
VAR要求:的URLRequest =新的URLRequest(HTTP //:www.google.com);
navigateToURL(请求_blank);
}
 

和给我的按钮sub_btn的实例名称。

你能告诉我,我已经错了。

解决方案

您的问题是,code执行,其中在框架上, sub_btn 不存在(当你在你的评论指出,这是在后面的帧)。

ppt设置超链接按钮

您要么需要:

将按钮的第一帧,

将code引用它与按钮框。

I have created a button using flash Pro cc I've been doing research but was unable to find why a TypeError stating "TypeError: Error #1009: Cannot access a property or method of a null object reference.at PD3Subscribenow_fla::MainTimeline/frame1()" I have placed my code on a action layer on frame 1:

import flash.events.MouseEvent;
sub_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http//:www.google.com");
navigateToURL(request, "_blank");
}

and gave the instance name of my button "sub_btn".

Can you tell me where I have gone wrong.

解决方案

You issue is that on the frame where the code executes, sub_btn does not yet exist (as you state in your comments that it is on a later frame).

You either need to:

Move the button to the first frame,

or

Move the code that references it to the frame with the button.

阅读全文

相关推荐

最新文章