Adobe Animate CC HTML 5打开URL [英] Adobe Animate cc HTML 5 open URL

查看:180
本文介绍了Adobe Animate CC HTML 5打开URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在cc动画中将图像加载到html 5画布中.单击图像中的某些位置时,需要转到一些URL.如何使用Animate cc Actions面板在新选项卡中为打开的URL编写代码.

I load image into html 5 canvas in animate cc. I need to go to some URL's when I click some places in image. How to write code for open URL in new tab using Animate cc Actions panel.

推荐答案

您可以使用代码段面板中提供的预制代码段. 首先,在舞台上创建一个动画片段并为其命名.然后选择此对象,打开代码片段面板,然后选择HTML5 Canvas> Actions>单击以转到网页.这样会在动作"面板中生成如下代码段:

You can use a premade snippet of code available in the code snippets panel. Firstly, create a movieclip on the stage and give it a name. Then with this object selected open the code snippets panel and choose HTML5 Canvas > Actions > Click to go to web page. This will produce a snippet like this in the actions panel:

this.btn.addEventListener("click", fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage() {
    window.open("http://www.adobe.com", "_blank");
}

将"btn"更改为您所谓的按钮,并将URL更改为您选择的URL.根据需要使用其他按钮重复操作.

Change "btn" to whatever you called your button and the url to your url of choice. Repeat as necessary with other buttons.

这篇关于Adobe Animate CC HTML 5打开URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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