Stilz Posted June 28, 2016 Share Posted June 28, 2016 Hello Guys, I'm Emanuel, i'm new on this forum and I want to ask you something about HTML5 games created in Animate CC. There is an alternative for external links in Animate CC for HTML5 Games ? I'm using this code: this.button.addEventListener("click", button_fun); function button_fun() { window.open("http://www.mysite1.com", "_blank"); } But i think isn't working for all the users, because my click rate on buttons was decreased. Thanks in advance! Emanuel. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted June 29, 2016 Share Posted June 29, 2016 Just use an anchor, that way it'll be discoverable too, not too mention accessibility. Stilz 1 Quote Link to comment Share on other sites More sharing options...
Stilz Posted June 29, 2016 Author Share Posted June 29, 2016 Hello mattstyles, can you give me an example please? Thanks! Quote Link to comment Share on other sites More sharing options...
mattstyles Posted June 30, 2016 Share Posted June 30, 2016 I'm not sure how Animate CC works but as you're grabbing a DOM node to append an event listener I'm guessing you can create DOM fairly easily, just add an anchor tag to your DOM: <a href="http://mysite1.com" target="_blank">Click Me</a> The browser knows this is a link to an external site, it knows nothing about the JS that you were previously using. This means robots indexing your site can understand it better, which gives you a better ranking. Screenreaders can understand it (might not be an issue for a game). It also keeps unnecessary JS from cluttering your files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.