简体   繁体   English

为什么此按钮的代码无法进入网页工作?

[英]Why isn't the code for this button to go to web page working?

I'm working Adobe Animate and I've been looking for a solution to this issue, but haven't been able to find anything. 我正在使用Adobe Animate,并且一直在寻找解决此问题的方法,但找不到任何东西。 I'm new to coding in general, but have some experience. 我一般都不熟悉编码,但是有一些经验。

What I'm trying to do is have a button link to a website and all the code I've been able to find hasn't been able to make it work. 我想做的是有一个指向网站的按钮链接,而我一直无法找到的所有代码都无法使其正常工作。 All I need it to do is function by clicking the button and it go to the page in a new tab. 我需要做的就是单击按钮,然后转到新标签页中的功能。 I tried the code snippet and got an error, but I've resolved that now and the button won't work. 我尝试了代码段,但出现了错误,但是现在我已经解决了,该按钮将无法使用。

See the code below. 请参见下面的代码。

function btn1Click(evt:MouseEvent):void { 函数btn1Click(evt:MouseEvent):void {

var url:String = " https://www.discovergreece.com/en/wellness-and-spas "; var url:String =“ https://www.discovergreece.com/en/wellness-and-spas ”;

var req:URLRequest = new URLRequest(url); var req:URLRequest =新的URLRequest(url);

navigateToURL(req); 的navigateToUrl(REQ);

} }

Any assistance is appricated. 会提供任何帮助。

因此,我的解决方案是简单地删除我制作的按钮,然后制作一个透明框,该框覆盖从第1帧开始的整个动画,然后使用AS3的代码段即可。

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

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