Adobe Animate cc HTML 5 open URL

拥有回忆 提交于 2019-12-13 03:05:39

问题


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.


回答1:


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");
}

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



来源:https://stackoverflow.com/questions/46609874/adobe-animate-cc-html-5-open-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!