简体   繁体   English

Animate CC HTML 5-单击第二个按钮不起作用

[英]Animate CC HTML 5 - click on second button not working

I'm just a beginner in Javascript, and I'm making simple web canvas in Animate CC with few buttons. 我只是Java语言的初学者,而且我在Animate CC中制作了带有几个按钮的简单Web画布。 I add code and first button (AN_Jar) work perfectly, but second (Home_Jar) doesn't work. 我添加了代码,第一个按钮(AN_Jar)正常工作,但第二个(Home_Jar)不起作用。

Here it is: 这里是:

 this.AN_Jar.addEventListener("click", fl_onClick_01.bind(this));

function fl_onClick_01()
{
    this.gotoAndStop(4);
}


this.Home_Jar.addEventListener("click", fl_onClick_home1.bind(this));

function fl_onClick_home1()
{
    this.gotoAndStop(3);
}

What I'm missing? 我想念的是什么? (I had this website in written in actionscript 3 and it work perfectly well.) (我使用动作脚本3编写了该网站,并且运行良好。)

When I run the following code, with two movieclips named on stage with the names in your code, I can see each button being triggered: 当我运行以下代码时,在舞台上用您的代码中的名称命名了两个影片剪辑,我可以看到每个按钮都被触发了:

    this.AN_Jar.addEventListener("click", fl_onClick_01.bind(this));

function fl_onClick_01()
{
    console.log("bt1 hit")
}


this.Home_Jar.addEventListener("click", fl_onClick_home1.bind(this));

function fl_onClick_home1()
{
     console.log("bt2 hit")
}

This successfully traces "bt1 hit" and "bt2 hit" when I press each button,is there anything else you can tell us that you are doing? 当我按下每个按钮时,这成功地跟踪了“ bt1 hit”和“ bt2 hit”,您还能告诉我们您在做什么吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM