闪光灯临超链接按钮错误 [英] Flash Pro Hyperlink button error

查看:155
本文介绍了闪光灯临超链接按钮错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了使用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 不存在(当你在你的评论指出,这是在后面的帧)。

您要么需要:

  1. 将按钮的第一帧,

<醇开始=2>
  • 将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:

    1. Move the button to the first frame,

    or

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

    这篇关于闪光灯临超链接按钮错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆